是否有一种方法可以列出更改特定文件的所有提交?
当前回答
Git日志路径应该做你想做的。从git日志手册页:
[--] <path>…
Show only commits that affect any of the specified paths. To prevent confusion with
options and branch names, paths may need to be prefixed with "-- " to separate them
from options or refnames.
其他回答
gitk <path_to_filename>
假设已经安装了包“gitk”。
如果没有安装,请执行以下操作:
sudo apt-get install gitk
然后尝试上面的命令。它是Linux的…如果Linux用户需要GUI,它可能会对他们有所帮助。
如果你想通过文件名而不是文件路径来查找所有的提交,使用:
git log --all -- '*.wmv'
——follow适用于特定的文件
git log --follow -- filename
与给出的其他解的区别
注意,其他解决方案包括git日志路径(没有——follow)。如果你想跟踪目录中的变化,但是当文件被重命名时(因此使用——follow filename),这种方法很方便。
Git日志路径应该做你想做的。从git日志手册页:
[--] <path>…
Show only commits that affect any of the specified paths. To prevent confusion with
options and branch names, paths may need to be prefixed with "-- " to separate them
from options or refnames.
如果你想查看所有修改文件的提交,在所有分支中,使用这个:
git log --follow --all <filepath>
推荐文章
- 为什么我需要显式地推一个新分支?
- 如何撤消最后的git添加?
- Rubymine:如何让Git忽略Rubymine创建的.idea文件
- Gitignore二进制文件,没有扩展名
- Git隐藏错误:Git隐藏弹出并最终与合并冲突
- 了解Git和GitHub的基础知识
- 没有。Git目录的Git克隆
- Git与Mercurial仓库的互操作性
- 忽略git中修改(但未提交)的文件?
- “git restore”命令是什么?“git restore”和“git reset”之间有什么区别?
- Git合并与强制覆盖
- Git拉另一个分支
- 在Bash命令提示符上添加git分支
- 如何更改Git日志日期格式
- git pull -rebase和git pull -ff-only之间的区别