How to reduce friction when pushing code to Git

Bernie CamejoBernie Camejo
1 min read

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.

0
Subscribe to my newsletter

Read articles from Bernie Camejo directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Bernie Camejo
Bernie Camejo