我正在使用 Visual Studio 2017 并尝试使用 VS 2017 中的 Git 插件将我的本地更改同步推送到远程存储库。 我上演了我的更改并提交了它们。现在,当我尝试推送更改时,出现以下错误-
Error encountered while pushing to the remote repository: rejected Updates were rejected because the tip of your current branch is behind its remote counterpart. Integrate the remote changes before pushing again.
所以我尝试首先从远程存储库中获取并 pull 最新的更改。提取成功但是当我提取传入的提交时它给出了以下错误-
Error: Your local changes to the following files would be overwritten by merge: Error: merging of trees 73d9f5683703dbb7dede45aa858a9dc46a156f07 and e59a44271f3ae2b73e397cdade39d4270e7a773c failed
理想情况下, pull 应该获取并 merge 更改。我尝试搜索一些解决方案并找到了这个链接- VS 2017 - Git failed with a fatal error
此解决方案对我不起作用。有什么想法可以解决这个问题吗?
最佳答案
同时 git stash
尚未(2017 年第 4 季度)可用于 Visual Studio(请参阅 this uservoice ),您仍然可以在命令行中存储当前修改的文件:
cd /path/to/your/repo
git stash
然后你的 git pull 就可以继续了。输入 git stash pop
以取回您当前的更改。
关于git - 无法与 Visual Studio Git 插件同步更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47605238/