无法在 Visual Studio 2013 中同步 Git

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21471169/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 09:40:03  来源:igfitidea点击:

Cannot Sync Git in Visual Studio 2013

gitvisual-studio-2013

提问by onefootswill

I'm working with another developer and we seem to have got ourselves into a GIT pickle. I commit code regularly and regularly push to the remote master. My colleague (whilst a great guy and developer) has not got into the habit of doing this and when I went to Pull the Head revision this morning (as is my habit), I was faced with the following error message:

我正在与另一位开发人员合作,我们似乎已经陷入了 GIT 泡菜。我定期提交代码并定期推送到远程主服务器。我的同事(虽然是一个伟大的人和开发人员)还没有养成这样做的习惯,当我今天早上去 Pull the Head 修订版时(这是我的习惯),我遇到了以下错误消息:

Cannot pull because there are uncommitted changes. Commit or undo your changes before pulling again. See the Output window for details.

无法拉取,因为有未提交的更改。在再次拉取之前提交或撤消您的更改。有关详细信息,请参阅输出窗口。

I then noticed there were 5 incoming commits dating back to 5 days earlier. I have no local commits at all and no staged changes.

然后我注意到有 5 个可追溯到 5 天前的传入提交。我根本没有本地提交,也没有分阶段的更改。

I've tried Sync'ing, pulling and everything else I could in the VS interface to no avail.

我在 VS 界面中尝试了同步、拉动和其他一切都无济于事。

Has anyone else experienced this and can they help me resolve it please.

有没有其他人遇到过这种情况,请他们帮我解决。

Thanks

谢谢

回答by katibaer

I had the same problem, because a number of package files were removed on the server which were not being used. I had to open command prompt and see all errors by running:

我遇到了同样的问题,因为在服务器上删除了一些未被使用的包文件。我必须打开命令提示符并通过运行查看所有错误:

git pull

I saw this error with a list of files to remove:

我在要删除的文件列表中看到了这个错误:

Please move or remove them before you can merge.
Aborting. 

After removing them I was able to successfully do a pull.

删除它们后,我能够成功地进行拉动。