问题描述
如果这不是很清楚,但是在Git中,我发现了一种方法,可以通过名称查看分支上所有已更改的文件。
据我所知,我可以使用git log来查看在一次提交中发生了变化的文件,但是我希望看到自创建分支以来发生过更改的所有文件,并通过多次提交。
I apolagise if this isn't very clear but in Git, is there a way to see all changed files on a branch, by name only.As far as I know I can use git log to see files that have changed in a single commit but I want to see all files that have changed since the branch was created, over several commits.
有git diff,但这也列出了我不想看到的比较分支中的已更改文件。我有点想要一个命令说'给我显示这个分支中所有已更改文件的文件名'。
There is git diff but this also lists the changed files in the branch I'm comparing to which I don't want to see. I kind of want a command that says 'show me file names for all changed files in this branch'.
非常感谢
Many thanks
推荐答案
假设您在分支 foo
,你有兴趣知道哪些文件在从 master
分歧的位置发生了变化,你可以这样做:
Supposing you're on branch foo
, and you're interested in which files have changed since the point when it diverged from master
, you can just do:
git diff --name-only master...
p>
(Note the three dots.) If you're not foo
, you can use the full form:
git diff --name-only master...foo
我制作了一些图形来解释双点和三点符号,以及它们在 git rev-list
和 git log
- 你可以在。
I made some graphics that explain the double-dot and triple-dot notations, and their differences between their meaning in git rev-list
and git log
- you can find them in this answer.
这篇关于有没有办法在Git的分支上查看所有更改的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!