Skip to content

Instantly share code, notes, and snippets.

@timohuovinen
Last active January 4, 2023 23:09
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 timohuovinen/4b24ba94d333b1b6533625f647588c2d to your computer and use it in GitHub Desktop.
Save timohuovinen/4b24ba94d333b1b6533625f647588c2d to your computer and use it in GitHub Desktop.
git add, commit, push shortcut

I got annoyed having to git add then git commit -a -m and then git push most of the time, so here's a shortcut.
Having to remove the quotes and re-add them was also annoying.

Add to /home/yourname/.bashrc

# add files, commit "my message" and push
function save {
  git add .
  git commit -a -m "$*"
  git push
}

Usage:

save my message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment