Skip to content

Instantly share code, notes, and snippets.

@neuthral
Created December 12, 2018 04:00
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 neuthral/5466464b34dcbbba8d844f0b5e42e900 to your computer and use it in GitHub Desktop.
Save neuthral/5466464b34dcbbba8d844f0b5e42e900 to your computer and use it in GitHub Desktop.
Lazy git add, commit, push
Building off of @Gavin's answer:
Making lazygit a function instead of an alias allows you to pass it an argument. I have added the following to my .bashrc (or .bash_profile if Mac):
function lazygit() {
git add .
git commit -a -m "$1"
git push
}
This allows you to provide a commit message, such as
lazygit "My commit msg"
You could of course beef this up even more by accepting even more arguments, such as which remote place to push to, or which branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment