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

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

问题描述

有没有办法列出更改特定文件的所有提交?

解决方案

--follow 适用于特定文件

git log --follow -- 文件名

与给出的其他解决方案的不同

请注意,其他解决方案包括 git log path(没有 --follow).如果您想跟踪例如,这种方法很方便.目录中的更改,但重命名文件时会出错(因此使用--follow filename).

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

解决方案

The --follow works for a particular file

git log --follow -- filename

Difference to other solutions given

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天全站免登陆