有时候我们在Vscode把更改后的代码想push到远程仓库
打开Vscode终端然后输入一段代码 :git remote add origin+(HTTPS或者SSH)对远程仓库进行连接
然后进行推送的时候终端提示:git push error: failed to push some refs to…
这是因为我们仓库的README.md文档不在本地代码目录中,也就是说我们需要先将远程代码库中的任何文件先pull到本地代码库中,才能push新的代码到github代码库中。
解决措施:
使用如下命令:git pull --rebase origin master
然后再进行上传: git push -u origin master
参考链接:https://www.cnblogs.com/whel0923/p/10782246.html