12

ブランチにいくつかの変更をコミットしましたnew

にチェックアウトしmasterます。

マージしようとしたとき:

$ 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.

そこで、kdiff3 をインストールして構成ファイルを構成し、mergetools を使用しようとすると、次のようになりました。

$ git mergetool kdiff3
No files need merging

diff を実行したところ、次のように出力されました。

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

これを解決する方法について混乱しています。これを可能な限り簡単な方法で解決したいのですが、ブランチ new から情報を失ってもあまり気にしませんが、何がうまくいかなかったのか、なぜ解決できないのかを理解したいのです。マージ ツールを使用しないでください。

マージの競合が発生しているのに、ファイルをマージする必要がないのは奇妙に思えます。

4

3 に答える 3

5

あなたのmergetoolコマンドが間違っていると思います。する必要があります

$ git mergetool

または

$ git mergetool --tool=kdiff3

git コマンドで行き詰まった場合は、いつでもマニュアルを確認できます ( git mergetool --help)。

詳細: https://www.kernel.org/pub/software/scm/git/docs/git-mergetool.html

于 2013-03-29T16:45:29.023 に答える