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

2
  • Have your figured this out? I am having the same issue.
    – Vincent
    Feb 5, 2014 at 0: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 5, 2014 at 11:06

12 Answers 12

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.

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.

1
  • 'git' is not recognized as an internal or external command, operable program or batch file.
    – Christine
    Nov 11, 2015 at 17:24
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

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

1
  • In my case there was a directory more than 256 characters. Thanks yeoman.
    – Jess
    Jun 11, 2015 at 17:25
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

0

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

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.

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.

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

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'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.