Skip to content

Commit dc8e9d6

Browse files
committed
root and merge commits tips.
1 parent b238e44 commit dc8e9d6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
* [Checkout a new branch without any history](https://github.com/git-tips/tips#checkout-a-new-branch-without-any-history)
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)
103+
* [List only the root and merge commits.](https://github.com/git-tips/tips#list-only-the-root-and-merge-commits)
103104

104105
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
105106
<!-- @doxie.inject end toc -->
@@ -683,5 +684,10 @@ git diff --staged
683684
git show <banch_name>:<file_name>
684685
```
685686

687+
## List only the root and merge commits.
688+
```sh
689+
git log --first-parent
690+
```
691+
686692
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
687693
<!-- @doxie.inject end -->

tips.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,4 +305,7 @@
305305
},{
306306
"title": "Extract file from another branch.",
307307
"tip": "git show <banch_name>:<file_name>"
308+
}, {
309+
"title": "List only the root and merge commits.",
310+
"tip": "git log --first-parent"
308311
}]

0 commit comments

Comments
 (0)