merging two commits into one.

This commit is contained in:
S N Munendra 2016-05-18 17:33:13 +05:30
parent dc8e9d6f96
commit 80e1993266
2 changed files with 9 additions and 0 deletions

View File

@ -101,6 +101,7 @@
* [File diff between staging and the last file version.](https://github.com/git-tips/tips#file-diff-between-staging-and-the-last-file-version)
* [Extract file from another branch.](https://github.com/git-tips/tips#extract-file-from-another-branch)
* [List only the root and merge commits.](https://github.com/git-tips/tips#list-only-the-root-and-merge-commits)
* [Merge previous two commits into one.](https://github.com/git-tips/tips#merge-previous-two-commits-into-one)
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end toc -->
@ -689,5 +690,10 @@ git show <banch_name>:<file_name>
git log --first-parent
```
## Merge previous two commits into one.
```sh
git rebase --interactive HEAD~2
```
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end -->

View File

@ -308,4 +308,7 @@
}, {
"title": "List only the root and merge commits.",
"tip": "git log --first-parent"
}, {
"title": "Merge previous two commits into one.",
"tip": "git rebase --interactive HEAD~2"
}]