### 3. Alias
```sh
git config <level> alias.<alias name> '<your sequence of git commands>'
git config --global alias.tree 'log --graph --decorate -pretty=oneline --abbrev-commit'
```
```
# level
-- global
```
'global' means any other repository for my user account on this computer will have this command available
For the system level, we will use the --system option. If you don't specify any of these two options, the config will take effect only in the
repository that you are in now.
examples
```
$ 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.cm "commit -m"
$ git config --global alias.unstage 'reset HEAD --'
$ git unstage myfile.txt
$ git reset HEAD myfile.txt
# undo
$ git config --global alias.undo 'reset --soft HEAD~1'
```
> git last
```
$ git config --global alias.undo 'reset --soft HEAD~1'
```
> Advanced aliases with external commands
```
$ git config --global alias.cm '!git add -A && git commit -m'
```
> Removing an alias
```
$ git config --global --unset alias.cm
```