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
Use git 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 is git rebase -i HEAD~5.
You can also see
https://blog.csdn.net/yinchuan_111/article/details/106913632
超強干貨來襲 云風專訪:近40年碼齡,通宵達旦的技術(shù)人生總結(jié)
以上是生活随笔為你收集整理的Squash my last X commits together using Git | Git 如何合并历史提交记录?的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: leetcode 279. Perfec
- 下一篇: 灵魂拷问:用移位来代替除法运算真的效率高