Skip to content

Instantly share code, notes, and snippets.

@tackme31
Last active January 26, 2024 06:47
Show Gist options
  • Save tackme31/e2aed43c5569021932ffb678999282bd to your computer and use it in GitHub Desktop.
Save tackme31/e2aed43c5569021932ffb678999282bd to your computer and use it in GitHub Desktop.
my git aliases
[alias]
st = status
ad = add -A
cm = commit
cmm = commit -m
cmf = commit --fixup
cman = commit --amend --no-edit
cmfr = "!f() { git commit --fixup \"$1\"; GIT_SEQUENCE_EDITOR=: git rebase -i --autosquash \"$1\"^; }; f"
f = fetch
p = pull
pp = "!f() { if [ -z \"$1\" ]; then git pull origin $(git branch --show-current); else git fetch origin \"$1\":\"$1\"; fi }; f"
pushh = push origin HEAD
reseth = reset --hard
resets = reset --soft
br = branch
ch = checkout
chp = checkout @{-1}
chb = checkout -b
chmr = "!f() { git checkout \"$1\"; git pull origin \"$1\"; git merge \"@{-1}\"; }; f"
mr = merge
mrp = merge @{-1}
cp = cherry-pick
rb = rebase
rbi = rebase -i
rbia = rebase -i --autosquash
l = log --oneline
l1 = log --oneline -1
l2 = log --oneline -2
l3 = log --oneline -3
l4 = log --oneline -4
l5 = log --oneline -5
l6 = log --oneline -6
l7 = log --oneline -7
l8 = log --oneline -8
l9 = log --oneline -9
l10 = log --oneline -10
l20 = log --oneline -20
l30 = log --oneline -30
l40 = log --oneline -40
l50 = log --oneline -50
l60 = log --oneline -60
l70 = log --oneline -70
l80 = log --oneline -80
l90 = log --oneline -90
l100 = log --oneline -100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment