1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > Squash my last X commits together using Git | Git 如何合并历史提交记录?

Squash my last X commits together using Git | Git 如何合并历史提交记录?

时间:2024-01-11 11:47:51

相关推荐

Squash my last X commits together using Git | Git 如何合并历史提交记录?

Question

stackoverflow - Squash my last X commits together using Git

How can I squash my last X commits together into one commit using Git?

Solution

Usegit rebase -i <after-this-commit>and replace “pick” on the second and subsequent commits with “squash” or “fixup”, as described in the manual.

In this example,<after-this-commit>is either the SHA1 hash or the relative location from the HEAD of the current branch from which commits are analyzed for the rebase command. For example, if the user wishes to view 5 commits from the current HEAD in the past the command isgit rebase -i HEAD~5.

You can also see

/yinchuan_111/article/details/106913632

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。