33

I'm using TFS with Git, installed Visual Studio Tools for Git.

I'm trying to pull all commits (5 in total) from TFS, but I get this error below:

An error occurred. Detailed message: An error was raised by libgit2. 
Category = Checkout (MergeConflict).
2 conflicts prevent checkout

How do I resolve this?

error

Null Reference
  • 11,260
  • 40
  • 107
  • 184
  • Have your figured this out? I am having the same issue. – Vincent Feb 05 '14 at 00:52
  • 1
    Deleting \.git\index.lock resolved it for me - Atlassian SourceTree gave me a more meaningful error! fatal: Unable to create '[...snip...]/.git/index.lock': File exists. If no other git process is currently running, this probably means a git process crashed in this repository earlier. Make sure no other git process is running and remove the file manually to continue – rohancragg Nov 05 '14 at 11:06

12 Answers12

20

Sadly, the Visual Studio plugin for Git doesn't display the error messages you need to troubleshoot this problem. (I hope they plan that feature for a later release.)

Try pulling the latest commits using Git Bash or using TortoiseGit. Either of those tools should let you know where your conflicts are.

dthrasher
  • 40,656
  • 34
  • 113
  • 139
16

To see the error you should run git command line You can find it at Team Emplorer -> Unsynched commits -> Actions -> Open in Command Prompt

Then you should use git pull command

Be careful with credential if you are using visualstudio.com, in this case you must have an alternative login and password for connect to git from command prompt.

Micha Wiedenmann
  • 19,979
  • 21
  • 92
  • 137
Oleg Krymskyi
  • 171
  • 1
  • 4
7

For resolving the issue follow below steps:-

1)Close visual studio.
2)Now Open visual studio without opening any solution..
3)Open team viewer and then go to git home->changes..
4)Then click on commit..
5)Now you will get the unresolved conflicts..
6)Resolve the conflicts and commit..

Problem Resolved :).
Cheers

user3848772
  • 79
  • 1
  • 1
5

This error often occurs when:

  • You have a proxy on your network:

    See some solutions on configuring your git proxy settings here.

  • or... The git url you are trying to connect to is over 256 characters

Community
  • 1
  • 1
Blowsie
  • 40,239
  • 15
  • 88
  • 108
1

Visual Studio Tool for Git didn't supported the remote repositories using the SSH protocol, only HTTP and HTTPS were supported but now it supports SSH as well.

See the url on how to resolve this- https://github.com/libgit2/libgit2sharp/issues/255

Manik Arora
  • 4,702
  • 1
  • 25
  • 48
0

Got a hint from @Blowsie, in my case, turned off fiddler capturing or similar packet capturing tool.

Youngjae
  • 24,352
  • 18
  • 113
  • 198
0

I was able to resolve this by doing a pull from Team Explorer in VS 2013 without having any solution open. Just do this one time.

This worked, and since then I haven't seen libgit error for any other solution as well.

This is tested for VS 2012 as well.

Tarun
  • 2,808
  • 3
  • 22
  • 21
0

This happens when your incoming fetch conflicts with your uncommitted files. first try to commit the changes you did or undo them. And try to push again. if it doesn't work, the conflict file should be in the Untracked files. Try to find it and delete it. this should work.

Dayan
  • 369
  • 1
  • 5
  • 12
0

Incoming and Outgoing commits in different branches. You must to marge them before sync. I do it in Source Tree, there you can clearly see branching.

0

First you need to commit local pending changes in local branch.then pull from master branch. resolved conflicts and push the local changes on master branch

Mihir
  • 1
0

1.Try to pull the project from cmd or git-bash by going into your project directory. if this solution is not correct for you.

you might cross your limit of using total users of your account. so try the second one. I got a solution by the second one.

2.This problem needs to increase your User limit in the bitbucket, Otherwise, delete someone's privileges from your list and add another one.

0

If it not working you have a second option by using terminal.

  1. Click on 'actions'
  2. choose 'open command prompt '
  3. and execute the command ' git push'