查看移动文件的GIT历史记录 [英] Viewing GIT history of moved files

查看:721

尝试使用 - 关注选项至 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆