File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 101101* [ File diff between staging and the last file version.] ( https://github.com/git-tips/tips#file-diff-between-staging-and-the-last-file-version )
102102* [ Extract file from another branch.] ( https://github.com/git-tips/tips#extract-file-from-another-branch )
103103* [ List only the root and merge commits.] ( https://github.com/git-tips/tips#list-only-the-root-and-merge-commits )
104+ * [ Merge previous two commits into one.] ( https://github.com/git-tips/tips#merge-previous-two-commits-into-one )
104105
105106<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
106107<!-- @doxie.inject end toc -->
@@ -689,5 +690,10 @@ git show <banch_name>:<file_name>
689690git log --first-parent
690691```
691692
693+ ## Merge previous two commits into one.
694+ ``` sh
695+ git rebase --interactive HEAD~2
696+ ```
697+
692698<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
693699<!-- @doxie.inject end -->
Original file line number Diff line number Diff line change 308308}, {
309309 "title" : " List only the root and merge commits." ,
310310 "tip" : " git log --first-parent"
311+ }, {
312+ "title" : " Merge previous two commits into one." ,
313+ "tip" : " git rebase --interactive HEAD~2"
311314}]
You can’t perform that action at this time.
0 commit comments