DEV Community

Cover image for Making git more productive with aliases
MutluDev
MutluDev

Posted on

Making git more productive with aliases

What is an alias

This would be a quick tutorial. If you ever checked your .bashrc file probably saw the alias keyword.
Creating alias in bash is like creating shortcut for command so instead of typing git status you can type gs and run the same command.

Creating new alias

Let's create an alias for git status command.

  1. Open your .bashrc file, you can use any text editor
  2. Add alias gs="git status" to end of the file
    • Let's inspect our code
    • alias - keyword
    • gs - shortcut
    • git status - full command

Example configuration that i use

alias gs="git status"
alias ga="git add -A"
alias gp="git push"

Ending

You can use aliases for every command. So be creative. If you find yourself typing the same command over and over again try making it shorter.
Thanks for reading this post.

Top comments (1)

Collapse
 
miguelmj profile image
MiguelMJ

So simple, yet so useful