Skip to content

Commit a7cb20e

Browse files
committed
List unpushed git commits.
1 parent b869dd5 commit a7cb20e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
144144
* [Apply commit from another repository](#apply-commit-from-another-repository)
145145
* [Specific fetch reference](#specific-fetch-reference)
146146
* [Find common ancestor of two branches](#find-common-ancestor-of-two-branches)
147+
* [List unpushed git commits](#list-unpushed-git-commits)
147148

148149
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
149150
<!-- @doxie.inject end toc -->
@@ -979,5 +980,21 @@ git fetch origin master:refs/remotes/origin/mymaster
979980
diff -u <(git rev-list --first-parent BranchA) <(git rev-list --first-parent BranchB) | sed -ne 's/^ //p' | head -1
980981
```
981982

983+
## List unpushed git commits
984+
```sh
985+
git log --branches --not --remotes
986+
```
987+
988+
989+
__Alternatives:__
990+
```sh
991+
git log @{u}..
992+
```
993+
994+
995+
```sh
996+
git cherry -v
997+
```
998+
982999
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
9831000
<!-- @doxie.inject end -->

tips.json

+4
Original file line numberDiff line numberDiff line change
@@ -421,4 +421,8 @@
421421
}, {
422422
"title": "Find common ancestor of two branches",
423423
"tip": "diff -u <(git rev-list --first-parent BranchA) <(git rev-list --first-parent BranchB) | sed -ne 's/^ //p' | head -1"
424+
}, {
425+
"title": "List unpushed git commits",
426+
"tip": "git log --branches --not --remotes",
427+
"alternatives": ["git log @{u}..", "git cherry -v"]
424428
}]

0 commit comments

Comments
 (0)