git 卡在“正在进行合并操作”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/44304423/
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
Stuck at "A merge operation in progress"
提问by Bernard Vander Beken
Steps
脚步
- In Visual Studio
- Pulled from remote repo
- 1 merge conflict.
- Merged manually, clicked 'Accept merge'
- 在 Visual Studio 中
- 从远程仓库拉取
- 1 合并冲突。
- 手动合并,点击“接受合并”
Result
结果
- Message: "A merge operation is in progress in the ... repository. Commit your changes to complete the merge operation."
- However, there is nothing to commit: There are 0 pending changes, no actions apart from Abort seem to be possible.
- 消息:“合并操作正在......存储库中进行。提交您的更改以完成合并操作。”
- 但是,没有什么可提交的:有 0 个待处理的更改,除了 Abort 之外似乎没有任何操作是可能的。
Screenshot: https://pbs.twimg.com/media/DBOeRIiXsAEbnLP.jpg
截图:https: //pbs.twimg.com/media/DBOeRIiXsAEbnLP.jpg
Context
语境
- remote git repo is hosted in Visual Studio Team Services
- Visual Studio 2017 with all updates
- 远程 git repo 托管在 Visual Studio Team Services 中
- 带有所有更新的 Visual Studio 2017
回答by RLH
I had a very similar problem with one of my projects which gave me the same TFS message in Visual Studio 2017. I was also using git. In my case I needed to manually add a comment to the commit before posting the merge. Since I had to manually merge the conflicts, a comment was needed rather than the auto-populated message that takes place on a merge without conflicts.
我的一个项目遇到了一个非常相似的问题,它在 Visual Studio 2017 中给了我相同的 TFS 消息。我也在使用 git。在我的情况下,我需要在发布合并之前手动向提交添加评论。由于我必须手动合并冲突,因此需要注释而不是在没有冲突的合并时自动填充的消息。
I'm well aware that commits need comments but if I recall correctly, VS 2015 would auto-populate the comment on a merge, even if you manually fixed any merge issues. Regardless, in VS 2017 you will need to add a commit comment when there are resolved conflicts.
我很清楚提交需要注释,但如果我没记错的话,VS 2015 会自动填充合并的注释,即使您手动修复了任何合并问题。无论如何,在 VS 2017 中,您需要在解决冲突时添加提交注释。
回答by Tingting0929
When get conflicts during a pull action from remote Git repository in Visual Studio, you need to do a manual merge to choose Remote or Local version. After you click 'Accept merge', you need to commit this merge operation. You will see that like this picture below.
当在 Visual Studio 中从远程 Git 存储库拉取操作期间发生冲突时,您需要进行手动合并以选择远程或本地版本。单击“接受合并”后,您需要提交此合并操作。您将看到如下图所示。
If you doesn't see this window, you could also commit from pending changes window. You can see that there's nothing under Changestab. This is because you choose local versionwhen you merge. Of cause, there's no file changes to show under Changes. But you still need to commit the merge operation.
如果您没有看到此窗口,您也可以从挂起的更改窗口提交。您可以看到“更改”选项卡下没有任何内容。这是因为合并时选择了本地版本。当然,在 Changes 下没有显示文件更改。但是您仍然需要提交合并操作。