Skip to content

Instantly share code, notes, and snippets.

@greenimpala
Created May 20, 2015 10:21
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 greenimpala/7a683f5d008b6be7be7c to your computer and use it in GitHub Desktop.
Save greenimpala/7a683f5d008b6be7be7c to your computer and use it in GitHub Desktop.
git commit
# Quick function that adds all unstaged / untracked files to the working tree.
# Applies a commit message by joining all the shell arguments and then pushes it to origin.
#
# Usage: `commit My first commit`
commit() {
git add -A
git commit -am "$*"
# Do not override users push settings
original_push_setting=`git config --global push.default`
git config --global push.default current
git push origin
git config --global push.default $original_push_setting
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment