Skip to content

Instantly share code, notes, and snippets.

@lukeramsden
Last active May 22, 2018 10:22
Show Gist options
  • Save lukeramsden/7f8f833b2e1d6a016c5d49928568b1b6 to your computer and use it in GitHub Desktop.
Save lukeramsden/7f8f833b2e1d6a016c5d49928568b1b6 to your computer and use it in GitHub Desktop.
ZSH function to commit and push to Git repo

Usage:

push                      # opens default editor for commit message, then pushes
push updated readme.md    # commits with message "updated readme.md", then pushes
function push() {
git add .
if [ $# -eq 0 ]; then
git commit -a
else
git commit -am "$*"
fi
git push
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment