History of subtree merged files

送分小仙女□ 提交于 2019-12-08 02:06:44

问题


I wanted to merge a folder from one repository to another according to the subtree merge method (according to How do you merge two Git repositories? and http://nuclearsquid.com/writings/subtree-merging-and-you/)

Now I'm confused since the files I added seem to have forgotten their history:

git log -p oneMergedFile

gives me a diff looking as if the file was newly added, while

git log

gives me the full history, i.e. containing the history of the merged branch. How can I get the entire history for oneMergedFile?


回答1:


-p oneMergedFile only shows the changes made to that file. Perhaps it wasn't part of your merge?

you could try gitk oneMergedFile to get a more visual history

one thing you could check is your config file for log.showroot

If false, git log and related commands will not treat the initial commit as a big creation event. Any root commits in git log -p output would be shown without a diff attached. The default is true.

Another possibility is that the merge included no changes the files you specified in -p. You could try --full-diff, which I think will show the file anyway.



来源:https://stackoverflow.com/questions/20077425/history-of-subtree-merged-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!