[Git] Configuring Git aliases

Configuring Git aliases

Sometime, git commands consisting of multiple flags and options are repetitively used. Creating a Git Alias would help avoid typing them.

Syntax

git config --global alias.{alias} "{command} --{flag} --{flag}..."

Example

The example blow is adding an alias for git log --oneline --graph --all --decorate, as git log. 

git config --global alias.tree "log --oneline --graph --all --decorate"

As of now, by typing git tree in the terminal, results like in the screenshot below would be displayed.
git tree
* 07e6087 (HEAD -> GTPS-71_create_an_html_and_css_for_the_blog, origin/GTPS-71_create_an_html_and_css_for_the_blog) GTPS-71 a basic HTML and CSS files prepared
* d140054 GTPS-71 rearranged the folder structure (not working yet)
* 1b247c0 (origin/main, origin/HEAD, main) autofilling implemetned
*   9b35828 (GTPS-65_implement_filling_game_db) Merge pull request #8 from Hyobin90/GTPS-51
|\
| * 6018280 (origin/GTPS-51, GTPS-51) GTPS-51 enhanced wikidata search implemented
| * 5e92811 GTPS-51 in pause for GTPS-56
|/
*   de3ad79 Merge pull request #7 from Hyobin90/GTPS-45_enhance_game_db_search

Comments