Skip to content

Instantly share code, notes, and snippets.

@michchan
Last active June 7, 2023 10:06
Show Gist options
  • Save michchan/b750950823a3fb98568423b33878fdb8 to your computer and use it in GitHub Desktop.
Save michchan/b750950823a3fb98568423b33878fdb8 to your computer and use it in GitHub Desktop.
Git Config (Aliases)
[alias]
aliases = "!f() { git config --global -l | grep alias | sort; }; f"
br = branch
cl = clone
st = status
a = add
cm = commit -m
cmn = commit -m --no-verify
cam = commit -am
co = checkout
fc = fetch
mr = merge
mra = merge --abort
mrc = merge --continue
pick = cherry-pick
pl = pull
plo = pull origin
plom = pull origin master
ph = push
phn = push --no-verify
pht = push --follow-tags
phf = push -f
phfn = push -f --no-verify
rb = rebase
rba = rebase --abort
rbc = rebase --continue
re = restore
ours = checkout --ours .
theirs = checkout --theirs .
tree = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset%n' --abbrev-commit --date=relative --branches
pushnew = push -u origin HEAD
current-branch = !git branch | grep '^*' | sed s/\\*\\ //
track = !git branch --set-upstream-to=origin/$(git current-branch) $(git current-branch)
[push]
default = current
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment