Skip to main content

Command Palette

Search for a command to run...

How to reduce friction when pushing code to Git

Updated

I was getting tired of doing git add ., git commit -m "Message", and git push. So I created a shell function in my .zshrc to do a single command that executes the three steps.

function gpush() {
    local msg="${1:-Auto commit}"
    git add .
    git commit -m "$msg"
    git push
}

Now, I don't have to repeat the same three steps, but rather call the gpush function.

gpush "Commit message"

And done.

More from this blog

Bernie Ops

20 posts