Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
804 views
in Technique[技术] by (71.8m points)

git tells me that I Merge conflict, but also tells me that no files need merging

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I tried

git mergetool .

Seemed to work.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...