DEV Community

Cover image for How to set up `git bro` command with git alias
Alex Verein
Alex Verein

Posted on • Updated on

How to set up `git bro` command with git alias

Have you seen people use the git bro command in terminal and always wondered how they do it?

It's actually very easy and I'm going to teach you now. Moreover, after mastering this technique you'll be able to use any command your imagination comes up with, like git cmon or git brunch.

I'll also share my own commands config in the end (quite conservative tbh).

You have git set up

First of all, you need git. I assume you already have it, if not, check this out.

Add the command

All you need to add a command is to define an alias, like this

git config --global alias.bro `branch`
Enter fullscreen mode Exit fullscreen mode

Manage the aliases

To see all the aliases run

git config --list
Enter fullscreen mode Exit fullscreen mode

To remove one run

git config --global --unset alias.bro
Enter fullscreen mode Exit fullscreen mode

My aliases

As I promised, in the end I share my setup

alias.co=checkout
alias.cm=commit
alias.st=status
alias.bro=branch
alias.br=checkout -b
alias.pushit=push -u origin HEAD
Enter fullscreen mode Exit fullscreen mode

Thanks for tuning in

That's it, now you can update your CV stating that you are bros with git!

👋

Top comments (0)