Visual Studio 2013 不提供在 Git pull 上进行合并 [英] Visual Studio 2013 does not offer to do merge on Git pull

查看:24
本文介绍了Visual Studio 2013 不提供在 Git pull 上进行合并的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Visual Studio 2013 Update 4 和 git(托管在 Visual Studio Online 上).我在远程分支中有 2 个本地提交和 2 个提交.没有要提交的本地更改:

I'm working with Visual Studio 2013 Update 4 and git (hosted on Visual Studio Online). I have 2 local commits and 2 commits in remote branch. There are NO local changes to commit:

当我尝试在 Visual Studio 中执行 Pull(或 Fetch)时,出现错误:

When I try to do Pull (or Fetch) in Visual Studio, I get error:

发生错误.详细信息:1 个冲突阻止结帐

An error occurred. Detailed message: 1 conflict prevents checkout

是的,有冲突,我应该合并.根据到此页面,我应该获得解决冲突的链接. 但我在 VS 中没有看到.

Yes, there is a conflict, I should do merge. And according to this page I should be offered a link to resolve conflict. But I don't see that in VS.

我可以在 VS 之外进行合并,但这不是重点.同时,我运行相同设置的同事可以毫无问题地进行合并.我的 VS 有什么问题?

I can do merge outside of VS, but that's not the point. At the same time, my workmate running the same set up can do the merge with no issues. What is wrong with my VS?

附言我安装了 msysgit,它可能弄乱了配置.根据这个 post 我的全局 .gitconfig 看起来像:

p.s. I have msysgit installed that might have messed with configurations. According to this post my global .gitconfig looks like:

[user]
    mail = trailmax@stackoverflow.com
    name = trailmax
    email = trailmax@stackoverflow.com
[core]
    excludesfile = C:\Users\trailmax\Documents\gitignore_global.txt
    autocrlf = true
    editor = "C:/Program Files (x86)/GitExtensions/GitExtensions.exe" fileeditor
[diff]
    tool = vsdiffmerge    
[difftool "vsdiffmerge"]
    cmd = "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\vsdiffmerge.exe" "$LOCAL" "$REMOTE" //t
    keepbackup = false
    trustexistcode = true
[merge]
    tool = vsdiffmerge
[mergetool]
    prompt = true
[mergetool "vsdiffmerge"]
    cmd = "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\vsdiffmerge.exe" "$REMOTE" "$LOCAL" "$BASE" "$MERGED" //m
    keepbackup = false
    trustexistcode = true
[credential]

推荐答案

就我而言,我看不到 解决冲突 选项,因为我还没有提交本地更改,我正在尝试与远程更改.一旦我提交了本地更改,然后再次尝试同步,解决冲突链接就会出现.

In my case I could not see the Resolve the conflicts option because I had local changes not committed yet and I was trying to sync with the remote changes. As soon as I committed my local changes and then tried a sync again, Resolve the conflicts link appeared.

所以这里的重点是:提交您的更改,然后尝试同步.合并将开始,Visual Studio 将允许您处理每个冲突.

So the point here is: commit your changes first and then try to sync. A merge will start and Visual Studio will allow you to go through each of the conflicts.

这篇关于Visual Studio 2013 不提供在 Git pull 上进行合并的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆