Created
August 18, 2011 00:27
-
-
Save grassdog/1153005 to your computer and use it in GitHub Desktop.
Script to show which commits aren't pushed to a remote
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Shows commits you haven't pushed to the remote yet. Accepts same | |
# arguments as git-log. Assumes 'origin' is the default remote if no | |
# branch.Foo.remote configuration exists. | |
curr_branch=$(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||') | |
origin=$(git config --get "branch.$curr_branch.remote") | |
origin=${origin:-origin} | |
git log $@ $curr_branch ^remotes/$origin/$curr_branch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment