In this code snippet post, we’ll list command line instructions for creating GIT aliases on the command line.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
git config --global alias.<alias> <command>
git config --global alias.<alias> <command>
git config --global alias.<alias> <command>
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
[alias]
co = checkout
cob = checkout -b
coo = !git fetch && git checkout
br = branch
brd = branch -d
st = status
aa = add -A .
unstage = reset --soft HEAD^
cm = commit -m
amend = commit --amend -m
fix = commit --fixup
undo = reset HEAD~1
rv = revert
cp = cherry-pick
pu = !git push origin `git branch --show-current`
fush = push -f
mg = merge --no-ff
rb = rebase
rbc = rebase --continue
rba = rebase --abort
rbs = rebase --skip
rom = !git fetch && git rebase -i origin/master --autosquash
save = stash push
pop = stash pop
apply = stash apply
rl = reflog
[alias] co = checkout cob = checkout -b coo = !git fetch && git checkout br = branch brd = branch -d st = status aa = add -A . unstage = reset --soft HEAD^ cm = commit -m amend = commit --amend -m fix = commit --fixup undo = reset HEAD~1 rv = revert cp = cherry-pick pu = !git push origin `git branch --show-current` fush = push -f mg = merge --no-ff rb = rebase rbc = rebase --continue rba = rebase --abort rbs = rebase --skip rom = !git fetch && git rebase -i origin/master --autosquash save = stash push pop = stash pop apply = stash apply rl = reflog
[alias]
  co = checkout
  cob = checkout -b
  coo = !git fetch && git checkout
  br = branch
  brd = branch -d
  st = status
  aa = add -A .
  unstage = reset --soft HEAD^
  cm = commit -m
  amend = commit --amend -m
  fix = commit --fixup
  undo = reset HEAD~1
  rv = revert
  cp = cherry-pick
  pu = !git push origin `git branch --show-current`
  fush = push -f
  mg = merge --no-ff
  rb = rebase
  rbc = rebase --continue
  rba = rebase --abort
  rbs = rebase --skip
  rom = !git fetch && git rebase -i origin/master --autosquash
  save = stash push
  pop = stash pop
  apply = stash apply
  rl = reflog

Tags: git, git command line, git shell, git bash, git ssh, git alias, git aliases, Version Control

CC BY 4.0 added intro and tags – 30 Seconds of Code