9

リモートオリジンのヘッドであるコミットが1つある間、私git pull --rebaseは最新のコードをプルしていました。しかし、最初の2回はエラーになりましたが、3回目はうまくいきました。

初めて:

remote: Counting objects: 165, done.
remote: Compressing objects: 100% (56/56), done.
remote: Total 111 (delta 77), reused 84 (delta 50)
Receiving objects: 100% (111/111), 18.37 KiB, done.
Resolving deltas: 100% (77/77), completed with 45 local objects.
From github.com:gumichina/crosskaiser-native
   e39c920..0491ecf  master     -> origin/master
First, rewinding head to replay your work on top of it...
Applying: complete friend list
Using index info to reconstruct a base tree...
M   application/Resources/CrossKaiser.ccbresourcelog
<stdin>:62: trailing whitespace.

<stdin>:100: trailing whitespace.

<stdin>:190: new blank line at EOF.
+
warning: 3 lines add whitespace errors.
Falling back to patching base and 3-way merge...
error: Your local changes to the following files would be overwritten by merge:
    application/Classes/CoverLayer/CoverLayer.cpp
    application/Classes/Friend/FriendList.cpp
    application/Classes/Friend/FriendList.h
    application/Classes/Friend/FriendListItem.h
    application/Classes/Friend/FriendListScene.cpp
Please, commit your changes or stash them before you can merge.
Aborting
Failed to merge in the changes.
Patch failed at 0001 complete friend list
The copy of the patch that failed is found in:
   /Users/tangyue/project/crosskaiser-native/.git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

次に、次のように入力git statusします。

# Not currently on any branch.
# You are currently rebasing.
#   (all conflicts fixed: run "git rebase --continue")
#
nothing to commit, working directory clean

detach ブランチに変更され、変更されたファイルがないのは奇妙でした。

だから私はそれを中止しましたgit rebase --abort

2回目:

First, rewinding head to replay your work on top of it...
Applying: complete friend list
Using index info to reconstruct a base tree...
M   application/Resources/CrossKaiser.ccbresourcelog
<stdin>:62: trailing whitespace.

<stdin>:100: trailing whitespace.

<stdin>:190: new blank line at EOF.
+
warning: 3 lines add whitespace errors.
Falling back to patching base and 3-way merge...
error: Your local changes to the following files would be overwritten by merge:
    application/Classes/Friend/FriendListItem.cpp
    application/Classes/Friend/FriendListScene.cpp
Please, commit your changes or stash them before you can merge.
Aborting
Failed to merge in the changes.
Patch failed at 0001 complete friend list
The copy of the patch that failed is found in:
   /Users/tangyue/project/crosskaiser-native/.git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

次に、私は見ましたgit status

# Not currently on any branch.
# You are currently rebasing.
#   (all conflicts fixed: run "git rebase --continue")
#
nothing to commit, working directory clean

そして、それは最初の時と非常にていました。

再び私はそれを中止しましたgit rebase --abort

3回目:

First, rewinding head to replay your work on top of it...
Applying: complete friend list
Using index info to reconstruct a base tree...
M   application/Resources/CrossKaiser.ccbresourcelog
<stdin>:62: trailing whitespace.

<stdin>:100: trailing whitespace.

<stdin>:190: new blank line at EOF.
+
warning: 3 lines add whitespace errors.
Falling back to patching base and 3-way merge...

今回もエラーなく正常に動作しました。

ログは次のようになりました。

* 25f45f8 (HEAD, master) complete friend list
* 0491ecf (origin/master, origin/HEAD) add need_level to stage
* 8eb488e modify deck manager
* 1deef55 add status bar for sell scene
* 46f57b5 manage dialog&menu button priority
* 491d7e6 modify card template
* 9d09b34 add stamina dialog
* e39c920 complete TextInput
* a60d1b3 fix the name of template

すべての操作中に何が起こったのか、誰か教えてもらえますか? そして、なぜ私はgit pull --rebase2回間違った後に正しくできたのですか?

4

1 に答える 1

8

これに関連している可能性があります。私はあなたと同じ問題を長い間抱えていました、これは助けになりました。しかし、この理由についてのコンセンサスは見つかりませんでした(ここにいくつかの議論があります)。何かがファイルのメタデータを変更しているようです。基本的にファイルのctimeをリセットしているため、gitはctime情報に依存しているときにファイルが変更されたと認識しません。

gitドキュメントへのリンクtrustctimegit-configgit-update-index

于 2013-02-28T15:21:21.110 に答える