Git in Visual Studio. Conflict prevents checkout

I am using git in Visual studio. When I am trying to synchronize, the following message appears.

An error occured. Detailed message: An error was raised by libgit2. Cetegory = checkout(MergeConflict). 1 conflicts prevent checkout

And I have not even a clue about what the conflicts are, and how to fix them. This is however really annoyng. Could you please help me with that?

  • Visual Studio 2013, Git Cloning Issue
  • How can you disable Git integration in Visual Studio 2013 permanently?
  • Is there VS analogue for vim's powerline?
  • TFS Git visual studio 2013 repo corruption or of behavior
  • visual studio 2013 GIT ignore list doesn't ignore dlls
  • AnkhSVN keeps marking .designer.cs files as newly added
  • Redeploying an early deployment using Visual Studio Online with Git For continuous delivery to Azure
  • Visual Studio 2013 Github commit deadlock
  • 7 Solutions collect form web for “Git in Visual Studio. Conflict prevents checkout”

    I have solved the same problem by using the Git command prompt in Visual Studio, because it gives you more ability:

    http://msdn.microsoft.com/en-us/library/vstudio/dd286572.aspx

    You also may install this extension to facilitate the work with it (it gives you ability do not enter passwords each time):

    http://gitcredentialstore.codeplex.com/

    Then I used this commands:

    git pull // I got an error on this step
    git stash
    git pull
    

    more information about commands here:

    http://git-scm.com/docs/git-pull

    http://git-scm.com/book/en/Git-Tools-Stashing

    http://git-scm.com/docs/git-commit

    And as CharlesB said it is due to “conflict between your changes and the changes from another branch”.

    You have some uncommited changes, commit or undo it and git pull will work

    I experienced this issue during a pull via visual studio.

    There was a change to a hidden file: .ntvs_analysis.dat

    So I:

    1. Show hidden files via control panel => folder options => view => show hidden files and dirs just to see that is was there
    2. In the project dir use the git gui to undo the change to that file

    After that the pull request was successful.

    Our environment requires us to not rely on Nuget auto package restore, and the problem I experienced was due to:

    • Some members only use GIT command console to commit / pull / push.
    • I rely on VS2013 Git tools to do Commit / pull /push.
    • The Git command console pushes all the content in the packages folder
    • Visual Studio tools ignores the packages folder

    So the conflict was due to files in the packages folder trying to be added via the VS pull, but already existed on the HDD.
    For now I just deleted the relevant packages folder/files and redid the pull, that worked.

    Hope this helps.

    if you have some changes in local then you just commit your changes and dont sync this commit

    changes => Enter a Commit Message => Commit and don’t Sync this commit,then you can pull correctly

    if you have not changes in your branch then go on Actions => Open Comment Prompt => then enter this lines

    1. git pull

    2. git stash

    3.git pull

    I had this issue and the way I resolved it was by “brute force”…I had no changes to commit, and no commits to sync but still got this error while trying to pull in some changes that another developer pushed.

    I ended up just whacking my local repo in the file system and re-cloning the remote branch. Voila!

    Perhaps not the most elegant solution, but it works if you don’t have any local changes that you are worried about losing.

    This sounds like the result of not adding executables and other auto generated output from Visual Studio to a .gitignore file. You don’t want to be source controlling those files. More information on this here.

    Git Baby is a git and github fan, let's start git clone.