如何找出分支中哪些文件已被修改?
我有两个分支:master 和 bug1。我检查了 bug1,做了很多更改和多次提交。如何获取分支上更改的所有文件的列表?我对哈希值、日期或任何其他提交相关的细节不感兴趣。我只想获得一个简单的触摸文件列表。
I have two branches: master and bug1. I checked out bug1, did bunch of changes and multiple commits. How do I get a list of all files that were changed on the branch? I'm not interested in hashes, dates or any other commit related details. I just want to get a simple list of touched files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
来自您的主人:
git diff --name-status BRANCH
请参阅
git diff
手册页 了解详细信息。From your master:
git diff --name-status BRANCH
See the
git diff
man page for details.在一个被建议与此问题重复的问题上给出的答案是对此问题的更正确答案。
如果您遵循此页面上当前的任何其他答案,您还将在输出中获得在分支上修改您实际感兴趣的文件期间发生的任何更改。
因此,它们仅在有限的情况下是正确的,在这种情况下,您的 master 恰好看起来与分支分叉时的情况完全相同。
这里的问题指定它只需要沿分支修改的文件(即相对于分叉点,或分支和主的“合并基础”)
The answer given on a question that was suggested to be a duplicate of this one, is a more correct answer to this question.
If you follow any other answers currently on this page here, you will also get in your output, any changes that have happened to master during the time that the files you are actually interested in were modified on branch.
So they are only correct in the limited subset of cases where your master happens to look exactly how it did back when the branch was forked off.
The question here specifies that it wants only the files that were modified along the branch (i.e. relative to the fork point, or "merge-base" of branch and master)