查看移动文件的GIT历史记录 [英] Viewing GIT history of moved files
问题描述
gitk myfile
似乎只显示历史,直到上一步行动。我知道GIT不会跟踪文件,只会跟踪他们的内容。所以,我应该能够查看文件的完整演变,即使它已被移动? 任何人都可以指导我一个很好但简单的示例/教程吗?
我希望看到一个例子,其中一些文件被移动,更改并提交,然后显示单个文件的历史记录,移动和全部文件。我一直在看'日志',但似乎与checkins有关。仍然会欣赏一些建议,即使它说我仍然想着太多的SVN。
解决方案尝试使用 - 关注选项至
git
git log --follow file.txt
Despite reading lots of other posts regarding GIT and moved files I still struggle to understand how to trace the full history. Doing gitk myfile
as suggested here seems to only show history until the previous move. I understand that GIT doesn't track files, only their content. So surely I should be able to view the full evolution of a file, even if it's been moved?
Can anyone direct me to a good yet simple example/tutorial?
I'd like to see an example where some files are moved around, changed and committed, then the history of a single file is displayed, moves and all. I've been looking at 'log' but that seems to concern checkins. Would still appreciate some advice, even if its says I'm somehow still thinking too much SVN.
Try using the --follow
option to git log
:
git log --follow file.txt
这篇关于查看移动文件的GIT历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!