Tag Archive
3D 3dprinting android ant BigData bitcoin Browsers C/C++ cryptocurrency CSS dd ddrescue dogecoin DOS editors find Games Git hadoop html html5 Java Linux litecoin node perl Postgres Programming Python scripting Shell SQL Swing TOTK Utilities utilization vi Video Web Web Design Wifi Windows Wordpress XML Zelda
Useful Git Aliases
When you use git often, it is helpful to implement some aliases for frequent commands. Git has config options to allow for shortening commands or allowing you to use a simple command instead of a line of text that is difficult to remember.
Some simple shortcuts:
To make checkout shorter
git config --global alias.co checkout
This will allow you to just type:
git co
To make status shorter:
git config --global alias.st status
This will let you see the log with branch indicators and a graph of the branches:
git config --global alias.mylog "log --pretty=format:'%h %s [%an]' --graph"
This is similar to the mylog alias but is useful on a color terminal as it will highlight useful items in the comments:
git config --global alias.lol "log --graph --decorate --pretty=oneline --abbrev-commit ==all"
The results will be the following lines in your .gitconfig file:
[alias] st = status co = checkout mylog = log --pretty=format:'%h %s [%an]' --graph lol = log --graph --decorate --pretty=oneline --abbrev-commit --all