Skip to content

Instantly share code, notes, and snippets.

@davidmoten
Last active August 29, 2015 14:09
Show Gist options
  • Save davidmoten/e661537a91fee662d52a to your computer and use it in GitHub Desktop.
Save davidmoten/e661537a91fee662d52a to your computer and use it in GitHub Desktop.
git commands
# shows uncommitted files and unpushed commits
function gits {
set -e
git status -s
CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD`
UNPUSHED=`git log origin/$CURRENT_BRANCH..$CURRENT_BRANCH`
if [ -z $UNPUSHED ]; then
echo Unpushed:
echo $UNPUSHED
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment