无法合并来自Visual Studio 2013的内部TFS GIT中的分支 [英] Unable to merge branch in in-house TFS GIT from Visual Studio 2013

查看:210
本文介绍了无法合并来自Visual Studio 2013的内部TFS GIT中的分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我环顾四周,无法找到接近我问题的答案,也没有完全理解正在解释的答案。



我有尝试将开发分支合并到主分支(两个起源分支)的问题



我收到错误 2未归档的更改将被合并覆盖



我尝试提交这2个更改,但没有任何更改。我的主人没有任何改变。



我不确定这是否与开发者离开有关,尽管TFS不知道任何事情他可能没有犯下。

我前一段时间不得不更改我的机器上项目的目录结构,虽然没有推/拉的问题。只有这一个合并问题

所以 - 有没有一种方法(如果你可以请解释,作为与TFS和GIT相当新的)强制合并,以便我的发展分支可以合并到主分支中。

解决方案

这是VS 2013中的一个错误,该文件。



我们在VS 2013 Update 3中修复了此错误的其中一个发生;升级可以帮助你。我们在VS 2013(更新4)的下一次更新中修复了这个错误的第二次发生,尽管我不知道我们何时会发布下一个更新。



这个bug是由于Visual Studio在寻找未分离的更改方面过于积极;它正在检测工作目录中的文件,该文件的混合行结束符已被修改。 (Git并没有将这种情况表现为未分离的变化,但是如果你要放弃本地文件系统缓存并使其检查文件系统,那么它就会。)



基本上,您的混合行结束符与您的 core.autocrlf .gitattributes 文件。



您可以:


  1. 使用 git-merge ,并忽略行结尾不匹配的情况,或者
  2. 通过确保您的文件在存储库中有一个 .gitattributes ,然后根据 GitHub提供的建议


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.

解决方案

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.

这篇关于无法合并来自Visual Studio 2013的内部TFS GIT中的分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆