List unpushed git commits.

This commit is contained in:
Hemanth.HM 2016-10-09 18:14:08 +00:00
parent b869dd5efd
commit a7cb20ee0f
2 changed files with 21 additions and 0 deletions

View File

@ -144,6 +144,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
* [Apply commit from another repository](#apply-commit-from-another-repository)
* [Specific fetch reference](#specific-fetch-reference)
* [Find common ancestor of two branches](#find-common-ancestor-of-two-branches)
* [List unpushed git commits](#list-unpushed-git-commits)
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end toc -->
@ -979,5 +980,21 @@ git fetch origin master:refs/remotes/origin/mymaster
diff -u <(git rev-list --first-parent BranchA) <(git rev-list --first-parent BranchB) | sed -ne 's/^ //p' | head -1
```
## List unpushed git commits
```sh
git log --branches --not --remotes
```
__Alternatives:__
```sh
git log @{u}..
```
```sh
git cherry -v
```
<!-- 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

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