DEV Community

rulo4
rulo4

Posted on

bash aliases for long or repetitive commands

There are some reasons that I have to create aliases for commands:

  • Too long command
  • Too frequently used command

These are some of them:

For git

alias master='git checkout master'

alias pull='git pull'

alias sts='git status'

alias gitp='git push -u origin "$(git branch --show-current)"'

alias glog='git log --format="%C(yellow) %h %C(cyan) %ci %C(magenta) %<(20,trunc) %cn %>(10,trunc) %cl %Cgreen %s" --name-status'
Enter fullscreen mode Exit fullscreen mode

For maven

alias mci='mvn clean install'

alias mcis='mvn clean install -DskipTests'
Enter fullscreen mode Exit fullscreen mode

To be used, we need to add them at the end of the .bashrc file located in the home directory.

Top comments (0)