0

I am using Visual Studio 2015 Update 3 with Git version control hosted by Visual Studio Team Services (VSTS). We follow the Git Workflow model, although I don't think that is actually relevant to the problem I am having.

I had a total of 74 changes in Visual Studio (a mixture of new files, deleted files, edited files and renamed files) that I successfully committed to my local feature branch. I switched to my local develop branch and successfully pulled down changes from the remote develop branch. I then switched back to my local feature branch and attempted to merge in changes from my local develop branch in to my local feature branch to sync it up with changes made by others before submitting a pull request. Visual Studio presented me with the following error message when attempting the merge:

An error occurred. Detailed message: 12 uncommitted changes would be overwritten by merge:

Visual Studio error message on merge attempt

This is an odd error message because my Changes window in Visual Studio is empty, suggesting that there are no uncommitted changes. I have seen suggestions that this might be due to new local files, however, there are more than 12 new files in my local commit so that wouldn't line up with the error message. It's also an error message that is very lacking in detail, i.e. no further information is provided as to which specific files are causing the merge problem.

Since Visual Studio aborted the merge, how do I identify which 12 files Visual Studio is having trouble merging, and then how do I go about resolving the merge problem? Also, can anyone shed any light on whether this is a Git problem, or a problem specific to Visual Studio's implementation of Git?

I have come from a TFS version control background and this is my first project using Git. I am not familiar with running Git from the command line and am hoping there is a UI-driven approach to solving this problem.

prlcutting
  • 379
  • 2
  • 12
  • Do you have Git Bash installed? – Scott Weldon Oct 10 '16 at 21:35
  • @ScottWeldon - No, I don't. I'm not familiar with Git Bash... how will that help? – prlcutting Oct 11 '16 at 03:06
  • Is your git ignore file different between the two branches? – JGTaylor Oct 13 '16 at 19:40
  • @JGTaylor - yes, in this case, it was. I had added an entry to my local feature branch's .gitignore to ignore one specific file in a specific path. Is this a known symptom of editing the .gitignore file? In other cases though where this problem has arisen, the .gitignore file was identical in both branches. – prlcutting Oct 14 '16 at 15:01
  • That error can happen when you have uncommitted changes that would be over written. What made me think your .gitIgnore file was different is that VS did not show you any active uncommitted changes. I believe, though not positive, is that git bash or Source Tree would NOT have given you an error in this specific case? :( – JGTaylor Oct 18 '16 at 17:55

0 Answers0