Shortcuts with Aliases
Git config alias.
Some commands you'll type hundreds of times a day. Git lets you create your own short names for them. They're called aliases, and they live in your Git config.

- Commands you type all day
- Make your own short names
- They're called aliases
Creating aliases
Git config dash dash global, alias dot s t, and the word status. Now git s t means git status. Let's add a few more. CO for commit. And one called graph, for that long log command we love. Now git graph draws the whole history, with just two words.
git config --global alias.st status git st On branch main nothing to commit, working tree clean git config --global alias.co commit git config --global alias.graph 'log --oneline --graph --all' git graph * f63a17a (HEAD -> main) Link to about page * ef9c947 Add basic styles * 6784119 Add about page * 0ba6049 Add welcome text * f7d9757 Add home page
Popular aliases
Here are some aliases many developers use. ST for status. BR for branch. Graph, for the long log command. And last, for log dash one, head, to see the latest commit. Keep yours short, and only make aliases for commands you really use a lot.
| key | value |
|---|---|
| git st | status |
| git br | branch |
| git graph | log --oneline --graph --all |
| git last | log -1 HEAD |
Summary
Git config dash dash global alias dot name creates a shortcut. Keep a few for your most used commands. Next, searching through history.
Key takeaways- git config --global alias.st status
- git st
- git graph