Darren Wainwright
Darren Wainwright

Reputation: 30747

Unable to merge branch in in-house TFS GIT from Visual Studio 2013

I've looked around SO and either can't find an answer close to my question or don't fully understand the answers being explained.

I am having an issue trying to merge a development branch into the master branch (both origin branches)

I receive the error 2 uncommitted changes would be overwritten by merge

I have switched branches in an attempt to commit these 2 changes, though don't have any. There are no changes to commit on my master.

I wasn't sure if it was perhaps related to a developer having left, though figured TFS wouldn't know about anything he may not have committed.

I also, some time ago, had to change the directory structure of the project on my machine, though have had no issues with push/pull. Just this one merge issue

So - is there a way (if you could please explain, as pretty new with TFS & GIT) to force the merge so that my development branch can be merged into the master branch.

Upvotes: 2

Views: 776

Answers (1)

Edward Thomson
Edward Thomson

Reputation: 78833

This is a bug in VS 2013 that results from your having mixed line endings in that file.

We fixed one of the occurrences of this bug in VS 2013 Update 3; upgrading may help you. We fixed the second occurrence of this bug in the next update to VS 2013 (Update 4), though I do not know when we will release the next update.

This bug is due to Visual Studio being overly aggressive in looking for unstaged changes; it's detecting a file in your working directory that has mixed line endings as modified. (Git is not showing this as an unstaged change, but it would if you were to blow away its local filesystem cache and make it examine the filesystem.)

Fundamentally, you have mixed line endings that do not match the settings in your core.autocrlf or .gitattributes file.

You can either:

  1. Use git-merge from the command-line and ignore the fact that your line endings are mismatched, or
  2. Fix the line endings in your files by ensuring that you have a .gitattributes in your repository, then normalizing the line endings in your files according to the suggestions that GitHub provides.

Upvotes: 1

Related Questions