在以下會話中,爲什麼git cherry-pick
的結果與複製的提交沒有相同的校驗和?它有相同的評論,作者,日期和家長。校驗和中還有什麼我沒有考慮的?爲什麼git cherry-pick會創建一個不同的校驗和?
謝謝。
~$ mkdir tmp
~$ cd tmp/
~/tmp$ git init
Initialized empty Git repository in /home/sinclairs/projects/tmp/.git/
~/tmp$ echo "asdf" >asdf
~/tmp$ git add asdf
~/tmp$ git commit -m asdf
[master (root-commit) 7d0aaa3] asdf
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 asdf
~/tmp$ echo "fdsa" >asdf
~/tmp$ git commit -a -m asdf2
[master b392367] asdf2
1 files changed, 1 insertions(+), 1 deletions(-)
~/tmp$ git log --format=oneline
b3923677106db9371faf55ed2cb8c7d06f586f7f asdf2
7d0aaa3937de390b7a119c73dbf9428126c1bac5 asdf
~/tmp$ git checkout -b mybranch HEAD^
Switched to a new branch 'mybranch'
~/tmp$ git cherry-pick master
Finished one cherry-pick.
[mybranch ca92f66] asdf2
1 files changed, 1 insertions(+), 1 deletions(-)
~/tmp$ git log --format=oneline
ca92f666cc53715c6b5ae2975b938275e0d20f73 asdf2
7d0aaa3937de390b7a119c73dbf9428126c1bac5 asdf
是的。在這個例子中,兩者的父代是7d0aaa3937de390b7a119c73dbf9428126c1bac5。 – 2011-03-01 09:54:43