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

扶醉桌前 提交于 2019-12-11 03:59:48

问题


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.


回答1:


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.


来源:https://stackoverflow.com/questions/24919455/unable-to-merge-branch-in-in-house-tfs-git-from-visual-studio-2013

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!