git告诉我,我合并冲突,但也告诉我,没有文件需要合并 [英] git tells me that I Merge conflict, but also tells me that no files need merging

查看:391
本文介绍了git告诉我,我合并冲突,但也告诉我,没有文件需要合并的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在分支 new 中进行了一些更改。 我检出当我尝试合并时:

 自动合并js / site.js 
CONFLICT(内容):在js / site.js中合并冲突
自动合并失败;修复冲突,然后提交结果。

所以我安装了kdiff3并配置了我的配置文件,当我尝试使用mergetools时: p>

  $ git mergetool kdiff3 
没有文件需要合并

我跑了一个差异,它输出了这个:

$ $ p $ diff --cc js / site.js
index 8c17d62,7955b13..0000000
--- a / js / site.js
+++ b / js / site.js
@@ @ -72,4 -81,18 +81,22 @@@函数doSmallScreen()

$(document).ready(function(){
calculateScreen();
- });
++<<<<<<< HEAD
++});
++ =======
+ $(window).resize(function(){
+ delay(function(){
+ calculateScreen();
+},500);
+});
+});
+
+
+ var delay =(function(){
+ var timer = 0;
+ return function(callback,ms){
+ clearTimeout(timer);
+ timer = setTimeout(callback,ms);
+};
- })();
++})();
++>>>>>>>新

我很困惑如何解决这个问题,我想以最简单的方式解决这个问题,我并不在意是否从新的分支中丢失了信息,但我想了解哪里出了问题,为什么我不能使用合并工具。



对我来说,看起来很奇怪,我有一个合并冲突,但是没有文件需要合并。

解决方案

我认为你的mergetool命令是错误的。应该是

  $ git mergetool 



  $ git mergetool --tool = kdiff3 

如果您遇到git命令,您可以随时查看手册( git mergetool --help

更多信息: https://www.kernel.org/pub/software/scm/git/docs/git-mergetool.html


I committed some changes in the branch new.

I checkout out to master.

When I tried to merge:

$ git merge new
Auto-merging js/site.js
CONFLICT (content): Merge conflict in js/site.js
Automatic merge failed; fix conflicts and then commit the result.

So I installed kdiff3 and configured my config files and when I tried to use mergetools I got:

$ git mergetool kdiff3
No files need merging

I ran a diff and it outputted this:

diff --cc js/site.js
index 8c17d62,7955b13..0000000
--- a/js/site.js
+++ b/js/site.js
@@@ -72,4 -81,18 +81,22 @@@ function doSmallScreen()

  $(document).ready(function () {
      calculateScreen();
- });
++<<<<<<< HEAD
++});
++=======
+     $(window).resize(function () {
+         delay(function () {
+             calculateScreen();
+         }, 500);
+     });
+ });
+
+
+ var delay = (function () {
+     var timer = 0;
+     return function (callback, ms) {
+         clearTimeout(timer);
+         timer = setTimeout(callback, ms);
+     };
 -})();
++})();
++>>>>>>> new

I am confused as to how to solve this, I want to solve this in the simplest manner possible, I don't really care if I lose the information from the branch new, but I want to understand what went wrong and why I can't use the merge tools.

It just seem weird to me that I have a merge conflict but no files need to be merged.

解决方案

I think your mergetool command is wrong. Should be

$ git mergetool

Or

$ git mergetool --tool=kdiff3

If you get stuck with a git command you can always check the manual (git mergetool --help).

More Info: https://www.kernel.org/pub/software/scm/git/docs/git-mergetool.html

这篇关于git告诉我,我合并冲突,但也告诉我,没有文件需要合并的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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