git alias list code example

Example 1: git list alias commands

# Alias to list all saved alias
git config --global alias.alias "!git config --get-regexp ^alias\."

#then
git alias

Example 2: git list aliases

$ git config --get-regexp alias

Example 3: git alias list

# Setup short form of commands to save keystrokes

git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status

Example 4: git alias

$ git config --global alias.co checkout
$ git config --global alias.br branch
$ git config --global alias.ci commit
$ git config --global alias.st status

Example 5: git list all global aliases

# Setup short form of commands to save keystrokes
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.unstage 'reset HEAD --'
git config --global alias.last 'log -1 HEAD'