Skip to content

Instantly share code, notes, and snippets.

@andrewhathaway
Last active December 13, 2015 22:19
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewhathaway/4983844 to your computer and use it in GitHub Desktop.
Save andrewhathaway/4983844 to your computer and use it in GitHub Desktop.
Add, commit and push function.
/*
* Commit And Push - CAP.
* Cap function to add, commit and push.
* Drop this in ~/.bash_profile
* Usage - cap 'commit message'
* - Andrew Hathaway
*/
cap() {
git add . ; /* Add all changes */
git commit -m "$1"; /* Commit the changes with the message */
git pull; git push; /* Pull first, then push */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment