如何在合并提交中显示功能分支的所有单独提交? [英] How to show all the individual commits of a feature branch in the merge commit?
问题描述
现在我正在使用以下内容合并&压树枝:
Right now I am using the following to merge & squash a branch:
- git checkout master
- git merge --squash功能分支
- git commit
- git push
这会在一次提交中将功能分支合并到master中,这几乎是我想要的.
This merges the feature branch into master in one single commit, which is almost what I want.
我可以使用拉取请求来实现.
因此,合并提交包含指向PR的链接,该链接提供了我在该功能分支中所做的所有提交的完整列表. https://i.stack.imgur.com/y2FZu.png
So the merge commit includes a link to the PR, which has a nice list of all the commits I made in that feature branch. https://i.stack.imgur.com/y2FZu.png
我想像GitHub pull request一样包含历史记录. https://i.stack.imgur.com/6f10X.png
I would like to include a history like a GitHub pull request does. https://i.stack.imgur.com/6f10X.png
我的问题是,有没有办法在不使用PR的情况下实现这一目标?我想显示与PR的提交列表相似的布局,但要在实际的合并提交本身中.
My question is, is there a way to achieve this without using a PR? I would like to show a similar layout to the PR's list of commits, but inside the actual merge commit itself.
推荐答案
git merge --squash
后,请尝试 .git/SQUASH_MSG
内的所有提交消息都应成为提交消息的一部分,这应使您可以跟踪壁球之前进行的各个提交.
All the commit messages inside .git/SQUASH_MSG
should then be part of your commit message, which should allow you to keep track of the individual commits that were done before the squash.
这篇关于如何在合并提交中显示功能分支的所有单独提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!