DEV Community

Cover image for Ever Heard of 'git commpush'? This Alias Might Change Your Git Game!
Usman Zahid
Usman Zahid

Posted on

Ever Heard of 'git commpush'? This Alias Might Change Your Git Game!

As developers, when we use a git platform and sync the changes to the remote, we add a new branch, push it, and set it upstream the first time, but then all we do is write this command, again and again.

git add . && git commit -m "I didn't do it" && git push
Enter fullscreen mode Exit fullscreen mode

And I have been writing for long enough and one day I thought why not make an alias of it?

And I came up with this idea, why not push my changes like this:

git commpush "Jason is responsible for the auth bug"
Enter fullscreen mode Exit fullscreen mode

So to use that command I made an alias like this:

git config --global alias.commpush '!f() { git add . && git commit -m "$1" && git push; }; f’
Enter fullscreen mode Exit fullscreen mode

After that, rather then staging the changes, then committing and then pushing the changes to the remote I just say commpush.

Far better isn't it?

Follow for more.

Top comments (0)