Introduction

To boost your productivity as a Software Developer, you can familiarize yourself with many topics.

I would say the most useful technical skills are those that shorten the time you use on trivial tasks. We all have to deal with daily repetitive tasks that constantly drain so much time from us.

This is why I would encourage you to do some things, such as master your IDE, use git aliases and all things you can think of that make you spend less time than needed.

What are Git aliases?

Let me just say it straight: Git aliases are a quicker way to write git commands.

That’s it! There’s not really much more to add.

Why should you use Git aliases?

If you could work less for the same amount of outcome you would do it, right?

If you answered yes, that’s the reason you needed to hear to start using Git aliases. Anyways, let me just enumerate some reasons to use them:

  • You will be more efficient.
  • You will learn a bit more about how is Git configured internally.
  • If you are like me, you will feel better by using them.
  • Bonus: You will definitely look cooler when you share the screen with your coworkers. 😉

How to create Git aliases

I hope I have convinced you to use Git aliases so far. I know you might not want to invest too much time in creating your own aliases and getting used to them. Well, I bring you good news! There are multiple ways to get started with Git aliases. The one I recommend the most is importing already existing Git aliases that someone thought of.

Here I will leave my favorite ones, so you can have a look at them and decide which one suits you best. The good news is, even if you don’t feel any of them is matching your vibe, you can edit them later.

https://github.com/GitAlias/gitalias

https://github.com/peterhurford/git-aliases.zsh

https://github.com/SixArm/gitconfig-settings

This is a list of the most useful commands I’m personally using since I use the GitAlias project (the first one listed).

git a = add
git aa = add --all

git c = commit
git ca = commit --amend

git co = checkout

git cp = cherry-pick
git cpa = cherry-pick --abort
git cpc = cherry-pick --continue

git m = merge
git ma = merge --abort
git mc = merge --continue

git pf = pull --ff-only
git pr = pull --rebase

git rb = rebase
git rba = rebase --abort
git rbc = rebase --continue

git rv = revert

git s = status

As you can see, once you get used to it you will start working way faster than you used to. This project has some common singularities for the commands such as adding at the end a for --abort, c for --continue

How to create your own aliases

If you want to create your custom aliases, you just have to run the following command

$ git config --global alias.co checkout

By doing so, we would’ve just created the alias co for checkout so the next time we run the command git co in reality, we would have written git checkout.

You can also edit your ~/.gitconfig file

[alias]
    st = status
    ca = commit --amend
    ma = merge --abort
    mc = merge --continue

Share Git aliases across all your devices

For some extra bonus points, I’ll leave you with this repository if you want to share your git aliases inside your organization.

Maybe it would be useful for some new joiners to your team, new to git aliases, to have already set up git aliases.

If that’s the case, just check this repository and follow the instructions. It’s really simple.

https://github.com/pipelineinc/alias4git

Conclusion

I will admit that I’m a geek about shortcuts. I love to learn all my IDE’s shortcuts and all that kind of stuff. This made me boost my productivity as I’m saving time in probably the most repeated actions on a daily basis.

Still, if you’re not yet convinced about using Git aliases, just give them a try. See how they affect (or not) your productivity.

If you liked this post, let me know if you would be interested in some other productivity booster ideas. Such as, mastering your IDE. Thanks for reading!