vscode git/gitlens

第一次创建
git init
git add . 将所有文件添加到本地git仓库
git commit -m "first commit"
git remote add origin https://github.com/XXX/xxxx.git 项目关联到远程仓库
git pull origin master
git push -u origin master
同步
之后的同步
已有仓库
cd existing_git_repo
git remote add origin https://gitee.com/xxx/xxx.git
git push -u origin master
上传代码参考:https://blog.csdn.net/diaopa0703/article/details/101353127
其他
remote错误
git remote remove origin
删除设置重新配置
无密码
git config --global credential.helper store
fatal: refusing to merge unrelated histories
可能由于使用了官方的 .gitignore 自动合并失败,需要手动合并之后再进行 add、commit 即可
git pull origin master --allow-unrelated-histories
参考:https://blog.51cto.com/laok8/2454524
443无网络
host添加,参考:https://www.jianshu.com/p/0493dcc15d6f
比挂v要好
详细参考:https://blog.csdn.net/high32/article/details/111941127