Skip to content

Instantly share code, notes, and snippets.

@0532
Last active November 18, 2021 12:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0532/52ad62d1d0c80f0c0d273e9a110317e4 to your computer and use it in GitHub Desktop.
Save 0532/52ad62d1d0c80f0c0d273e9a110317e4 to your computer and use it in GitHub Desktop.
git 命令常用别名,配置在.gitconfig文件下
[alias]
s = status
st = status
sb = status -s -b
#############
d = diff
di = diff
dc = diff --cached
dk = diff --check
dck = diff --cached --check
#############
c = commit
ca = commit -a
cm = commit -m
ci = commit
#############
l = log --oneline
lg = log --oneline --graph --decorate
#############
o = checkout
co = checkout
ob = checkout -b
cob = checkout -b
#############
b = branch
bv = branch -vv
ba = branch -a
bd = branch -d
br = branch -r
#############
f = fetch
fo = fetch origin
#############
m = merge
#############
ps = push
pl = pull
pb = pull --rebase
psf = push -f
psu = push -u
plu = pull -u
pso = push origin
plo = pull origin
pbo = pull --rebase origin
psfo = push -f origin
psuo = push -u origin
pluo = pull -u origin
#############
rb = rebase
#############
re = reset
rh = reset HEAD
reh = reset --hard
rem = reset --mixed
res = reset --soft
rehh = reset --hard HEAD
remh = reset --mixed HEAD
resh = reset --soft HEAD
#############
w = show
#############
human = name-rev --name-only --refs=refs/heads/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment