DEV Community

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

Posted on

2

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 (1)

Collapse
 
usmanzahidcode profile image
Usman Zahid

You should also add this alias:

git logline
Enter fullscreen mode Exit fullscreen mode

Which is an alias of:

git log --all --graph --online
Enter fullscreen mode Exit fullscreen mode

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay