如何列出更改了特定文件的所有提交? [英] How can I list all commits that changed a specific file?

查看:45
本文介绍了如何列出更改了特定文件的所有提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以列出所有更改了特定文件的提交?

Is there a way to list all commits that changed a specific file?

推荐答案

- -follow 适用于特定文件

git log --follow -- filename

与其他解决方案的区别

请注意,其他解决方案还包括 git日志路径(不包括-跟随)。如果您想跟踪例如目录中进行了更改,但在重命名文件时遇到了麻烦(因此请使用 -跟随文件名 )。

Note that other solutions include git log path (without the --follow). That approach is handy if you want to track e.g. changes in a directory, but stumbles when files were renamed (thus use --follow filename).

这篇关于如何列出更改了特定文件的所有提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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