git - 无法与 Visual Studio Git 插件同步更改

标签 git visual-studio github visual-studio-2017

我正在使用 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/

相关文章:

macos - git 对 Rstudio (OSX) 不可见的原因

visual-studio - Visual Studio 警告 C4133

git - 是否可以在分支之间移动文件或文件更改?

python - django 迁移 - 具有多个开发分支的工作流

git - Heroku Git 存储库大小

asp.net-mvc - Visual Studio ASP.NET 开发服务器不断返回旧页面

c++ - 预编译 header 和 __AFXWIN_H__

GIT 认为我已经做了更改,但我没有

github - 如何从 GitHub 拉取请求触发 Jenkins 2.0 Pipeline 作业

git - 推送被拒绝,未检测到 Cedar 支持的应用程序