The commit created by git subtree merge
or git subtree add
does an "add" for the files coming from the subtree, not a "move". This means that their history cannot be tracked as with other merges or movements.
History for the file you want can still be displayed by looking directly in the subtree before the merge. If your workspace is the merge commit that git subtree
created then the second parent of it (HEAD^2
) will be the last commit of the original subtree. From here you can see the contents of the original subtree:
# Display the contents of the original subtree
git ls-tree HEAD^2
From this commit you can track the changes of the file you are interested. Be careful that the path of your file will be different within the subtree that in your workspace. You will need to remove the --prefix
given to git subtree
in order to have the correct path for your file.
git log HEAD^2 --follow -- path-in-subtree/file
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…