July 20, 2023

Create, edit and delete git alias

For example, to create an alias so that you just have to type $ git st instead of $ git status, run:

$ git config --global alias.st status

Along this, you can also try:

$ git config --global alias.ci commit
$ git config --global alias.br branch


$ git config --global alias.last 'log --pretty=oneline -1 HEAD'

so that $ git last will print the last commit.

By the way, the option –global applies the alias to all repositories.

You can edit an alias by overriding an existing alias.

And to see or delete existing alias open the file .gitconfig by running:

$ vi /home/user/.gitconfig

git personal computing command-line interface (cli) gnu linux trisquel office applications wiki shell literacy

No affiliate links, no analytics, no tracking, no cookies. © 2016-2023 yctct.com. Content is licensed under CC BY-NC-SA 4.0 .