3

I am new to git in visual studio 2013 when i try to push changes i got the following error messages saying There are new remote changes. You must pull them before you can push.and when i try to pull the changes i get.

An error occurred. Detailed message: An error was raised by libgit2. Category = 21 (MergeConflict).
1 uncommitted change would be overwritten by merge
MohamedAbbas
  • 1,149
  • 4
  • 15
  • 31
  • start studying git: you have changes to local files that are not committed, and the remote has changes to the same files so it cannot be merged. This has not much to do with Visual Studio, it's more plain git. – stijn Jul 22 '14 at 08:20

2 Answers2

3

This appears to be a bug.

I had the same issue and then found this link: http://connect.microsoft.com/VisualStudio/feedbackdetail/view/955248/git-merge-fails-claiming-uncommited-change-would-be-overwritten-by-merge-ssh-mergeconflict

They say this will be fixed with Visual Studio 2013 Update 4.

(I should note that I was getting this even though I had no local uncommitted files.)

Rich Ward
  • 76
  • 7
  • 1
    I have update 4 now I have exactly the same isssue- all my local files _are_ committed. Frustrating, seems no way to pull it out of the outgoing commits either. – eagle779 Jan 22 '15 at 06:57
0

A merge conflict means that you have made some change to files on your local repository, resulting in differences between them and those on the remote repository. Git prevents you from merging with the above error so that you do not lose any of your work. If you don't care about what you've changed, there should be a force merge option (likewise, a force push option to get around the first error). Please note, however, that this would mean losing versions of your files, in effect defeating the whole purpose of git. Ideally, you should resolve your merge conflicts before continuing - this may be easier to do directly from the command line from within your git repo. There's a lot of info on the web about this kind of stuff:

How to resolve merge conflicts in Git?

Community
  • 1
  • 1