如果我执行 git fetch origin master 执行 git diff ...origin 如果我执行 git fetch (不指定分支)然后执行 git diff ...origin (见下文),则不会有相同的结果。这是为什么?(请注意:git 版本 1.7.3.1.msysgit.0)
git init parent && cd parent
echo 'version1' > contents.txt
git add contents.txt
git commit -m "version1"
cd ..
git clone parent child
cd child
echo 'child' >> contents.txt
git commit -a -m "Child"
cd ../parent
echo 'parent' >> contents.txt
git commit -a -m "Parent"
cd ../child
git fetch origin master
git diff ...origin
echo Expected diff here and it wasn't there!
git fetch
git diff ...origin
echo Ok, diff appeared properly now!