It is important to note that there is no direct git alias command. Aliases are created through the use of the git config command and the Git configuration files. As with other configuration values, aliases can be created in a local or global scope.
Your git aliases are often stored per your user's configuration at ~/. gitconfig . You can also manually set aliases using, for example, the command git config alias. s 'status -s' .
Add git alias The simplest way to add a git alias is by running a command to add the alias to the git global configuration file. For example, running the command git config --global alias. hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short" will add the alias git hist .
The command:
git config --global alias.co checkout
will create a git alias to do that. It will add the following entry into your global ~/.gitconfig
file:
[alias]
co = checkout
Also, can edit this into your git config:
[alias]
co = checkout
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With