Skip to content

Commit 80e1993

Browse files
committed
merging two commits into one.
1 parent dc8e9d6 commit 80e1993

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Diff for: README.md

+6
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
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>
689690
git 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 -->

Diff for: tips.json

+3
Original file line numberDiff line numberDiff line change
@@ -308,4 +308,7 @@
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
}]

0 commit comments

Comments
 (0)