Skip to content

Instantly share code, notes, and snippets.

@lukeramsden
Last active May 22, 2018 10:24
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 lukeramsden/5f5cefcdc73df377eb89ec2e6b2a54d1 to your computer and use it in GitHub Desktop.
Save lukeramsden/5f5cefcdc73df377eb89ec2e6b2a54d1 to your computer and use it in GitHub Desktop.
ZSH function to commit to Git

Usage:

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