Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2013 does not offer to do merge on Git pull

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:

Working directory clean

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

An error occurred. Detailed message: 1 conflict prevents checkout

An error occurred. Detailed message: 1 conflict prevents checkout

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.

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?

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

[user]     mail = [email protected]     name = trailmax     email = [email protected] [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] 
like image 248
trailmax Avatar asked Dec 13 '14 11:12

trailmax


People also ask

Does git pull do a merge?

The git pull command is actually a combination of two other commands, git fetch followed by git merge . In the first stage of operation git pull will execute a git fetch scoped to the local branch that HEAD is pointed at. Once the content is downloaded, git pull will enter a merge workflow.

How do I merge in Visual Studio?

To merge commits in Visual Studio, use the Ctrl key to select multiple commits that you want to merge. Then right-click and select Squash Commits. Visual Studio automatically combines your commit messages, but sometimes it's better to provide an updated message.

How do I merge files in git Visual Studio?

Visual Studio Git In the Branches pane of the Git Repository window, checkout the target branch. Then right-click the source branch and choose Merge <source-branch> into <target-branch>.


2 Answers

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.

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.

enter image description here

like image 179
Leniel Maccaferri Avatar answered Oct 12 '22 12:10

Leniel Maccaferri


I have encountered the same issue where "An error occurred. Detailed message: 1 conflict prevents checkout" is shown where there's no option to resolve the conflict as shown in Leinel's answer.

The reason was due to an untracked file that is the same file that is to be pulled. I just deleted the untracked file and retried the pull.

like image 20
Karlo Medallo Avatar answered Oct 12 '22 10:10

Karlo Medallo