DEV Community

loading...
Cover image for How to set up `git bro` command with git alias

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

Alex Verein
Used to be a mobile developer, now I build dev tools, working with 10+ programming languages. Follow me on Twitter for more dev content
Updated on ・1 min read

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!

👋

Discussion (0)