Created
September 29, 2025 16:14
-
-
Save subhransu/f39fcc414c5957de2a49973c19d0cd79 to your computer and use it in GitHub Desktop.
Git aliases for faster workflow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [alias] | |
| co = checkout | |
| cob = checkout -b | |
| cm = commit -m | |
| ca = commit --amend | |
| s = status -sb | |
| st = status | |
| aa = add --all | |
| ap = add -p | |
| br = branch | |
| brr = branch -r | |
| l = log --oneline --decorate --graph --all | |
| ls = log --graph --decorate --pretty=oneline --abbrev-commit | |
| ll = log --oneline --graph | |
| hist = log --pretty=format:'%C(yellow)%h%Creset %ad | %s %Cgreen%d%Creset [%an]' --graph --date=short | |
| who = shortlog -sne | |
| rom = rebase origin/main | |
| rc = rebase --continue | |
| rs = rebase --skip | |
| ra = rebase --abort | |
| pl = pull --rebase | |
| ps = push | |
| pf = push -f | |
| pu = push -u origin HEAD | |
| d = diff | |
| ds = diff --staged | |
| sa = stash apply | |
| sl = stash list | |
| ss = stash save | |
| sp = stash pop |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Setup
Option 1: Add directly to global config
Paste the
[alias]block into the opened file.Option 2: Save in a separate file
Create
~/.git-aliaseswith the alias block, then include it:git config --global include.path ~/.git-aliasesUsage Examples
cocheckoutgit co maincobcheckout -bgit cob feature/logincmcommit -mgit cm "Fix bug"cacommit --amendgit casstatus -sbgit sllog --oneline --decorate --graph --allgit lhistgit histwhoshortlog -snegit whoromrebase origin/maingit romplpull --rebasegit plpupush -u origin HEADgit pu