繁体   English   中英

壁球在请求请求时提交

[英]Squash Commits on Pull request

我被要求压缩我在github上的pull请求上的提交。 当我跑步

git rebase -i HEAD~5

看起来像这样

pick bcbb30d My commit comment
pick 8564706 Other persons commit comment
pick c99bdd2 Other persons commit comment
pick 07bb5b9 Other persons commit comment
pick 2bcff6f Other persons commit comment
pick 77a5076 My commit comment

因为我只想压缩我的提交,是否可以将“压扁”对我的所有对象(一个除外)(保留为“ pick”),其他人的提交也保留为“ pick”? 这只会挤我的提交吗?

试试这个

pick 8564706 Other persons commit comment
pick c99bdd2 Other persons commit comment
pick 07bb5b9 Other persons commit comment
pick 2bcff6f Other persons commit comment
pick bcbb30d My commit comment
squash 77a5076 My commit comment

您可以随意对提交进行重新排序和压缩。 因此,假设没有提交间的依赖关系,您可能应该将提交置于其他提交之上。

假设补丁可以很好地应用,您可以在从git rebase -i命令获得的编辑器中对它们进行重新排序,然后仅挤压您的补丁:

pick 8564706 Other persons commit comment
pick c99bdd2 Other persons commit comment
pick 07bb5b9 Other persons commit comment
pick 2bcff6f Other persons commit comment
pick bcbb30d My commit comment
squash 77a5076 My commit comment

现在,您将获得一个编辑器来修复您(合并的)提交消息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM