Increase efficiency in using Git with Aliases

Tram Ho

When working with the Git CLI, we often type a lot of command lengthy and repetitive. However, Git has Alias ​​support, so it is very useful and saves typing time, helping us to increase productivity and efficiency.

What is Git Alias?

alias (noun): alias, nickname, nickname.

Basically Git Alias ​​provides the ability to save a command with a different name (may be shorter or longer).

How to add Git Alias

There are 2 ways to add:

1 / Add to git config file: git config --global --edit

2 / Use Git CLI: git config --global alias.co checkout

How to use Git Alias?

After running one of the two commands above, we can now use Git Alias ​​for the checkout command. Instead of typing git checkout , now just type git co .

Parameters to commands you use as you normally would, for example, to create a new branch will be: git co -b new-branch

List of commonly used alias :

Above is how to use Git Alias ​​I just learned, through the process of using it, I feel quite effective. Hope it is also helpful to you.

Source: https://towardsdev.com/speed-up-your-git-workflow-with-aliases-2d9e69ff5535

Share the news now

Source : Viblo