Lazy Git Shortcut

If you use git and are tired of typing git add . then git commit -a -m “your git message” then git push, add an alias function to your bash_profile to do it all in one quick command. The example below works on macOS but I would imagine it would work in Powershell in Windows. Save a few keystrokes with the shortcut!

function gcp() {
  git add .
  git commit -a -m "$*"
  git push
}

Then in your command line type: gcp fixed a bug

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.