Skip to content

Instantly share code, notes, and snippets.

@aleclarson
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aleclarson/8f59bc9823b874fda0b7 to your computer and use it in GitHub Desktop.
Save aleclarson/8f59bc9823b874fda0b7 to your computer and use it in GitHub Desktop.
Useful git stuff

See local commits not yet pushed to remote

git config --global alias.unpushed "diff origin/$(git name-rev --name-only HEAD)..HEAD --name-status"
git unpushed

Script that creates an "unstable" branch (if one does not exist) and commits all changes to it.

if [ -z "`git branch | grep unstable`" ]; then
  git checkout -b unstable
else
  git checkout unstable
fi

git add --all
git commit -a -m "`date +'Build on %F at %r'`"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment