2016/04/27

git 好用的 alias


紀錄一下 git 好用的 alias 以避免公司鎖 evernote 讓我又找不到了

[alias]
co = checkout
ci = commit
di = diff --ignore-space-change --ignore-space-at-eol
st = status -sb
br = branch -v
rt = reset --hard
unstage = reset HEAD
uncommit = reset --soft HEAD^
l = log --pretty=oneline --abbrev-commit --graph --decorate
lg = "log --color --graph --oneline --decorate --pretty=format:'%C(auto)%h%Creset%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
amend = commit --amend
who = shortlog -n -s --no-merges
g = grep -n --color -E
cp = cherry-pick -x
nb = checkout -b

# 'git add -u' handles deleted files, but not new files
# 'git add .' handles any current and new files, but not deleted
# 'git addall' now handles all changes
addall = !sh -c 'git add . && git add -u'

# Handy shortcuts for rebasing
rc = rebase --continue
rs = rebase --skip
ra = rebase --abort

logf = log --follow
purge = clean -d -f -x
head = !sh -c 'git clean -d -f -x && git reset --hard HEAD'

沒有留言:

張貼留言