在git merge commit中列出所有修改过的文件 - 即使是快速转发 [英] List all modified files in git merge commit - even the fast forwarded
问题描述
我在考虑是否有一种方法,当我将一个分支合并到另一个分支中时,所有更改的文件都列在我的提交消息中,而不仅仅是两个分支中都修改过的分支。
这将通过查看合并提交而更好地了解分支中发生的更改。
有没有办法做到这一点?
我不知道如何在提交消息中做到这一点。但合并之后:
git log -m --name-only
这应该提供受合并提交影响的所有文件的名称。
仅限于提交文件的列表:
git log -m -1 --name-only --pretty =format: <合并SHA>
由于合并有两个父母,所以有一些空白区域,但可以轻松删除。 p>
I'm thinking if there is a way that when I merge a branch into another branch that ALL changed files are listed in my commit message and not just the ones which were modified in both branches. This would give me a better overview of what was changed in the branch just by seeing the merge commit. Is there a way to do this?
解决方案I don't know how to do that in the commit message. But after the merge doing:
git log -m --name-only
That should give the names of all the files affected by the merge commit.
For only a list of filenames of the commit:
git log -m -1 --name-only --pretty="format:" <Merge SHA>
There is some white space due to the merge having two parents but that can be easily removed.
这篇关于在git merge commit中列出所有修改过的文件 - 即使是快速转发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!