-
Notifications
You must be signed in to change notification settings - Fork 8
/
gitconfig
108 lines (107 loc) · 4.77 KB
/
gitconfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# vim: set ft=gitconfig :
[user]
name = Larry Lv
email = larrylv1990@gmail.com
[github]
user = larrylv
[alias]
al = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\t=> \\2/' | sort
br = branch
bv = branch -vv --color
changes = diff --stat -r
# checkout a branch without typing its name by using fzf
cf = !git checkout $(git branch | fzf| tr -d '[:space:]' | tr -d '*')
ci = commit
ca = commit --amend
cleanup = "!git branch --no-color --merged | grep -v '\\*\\|master\\|develop' | xargs -n 1 git branch -d && git remote prune origin && git prune && :"
co = checkout
conflicts = diff --name-only --diff-filter=U
delete = !git ls-files -z --deleted | xargs -0 git rm
done = "!f() { ([ `git rev-parse --abbrev-ref HEAD` == 'master' ] || git checkout master) && git branch -D @{-1}; }; f"
files-since = "!git diff --name-only $(git merge-base HEAD $1) | xargs ls 2>/dev/null && :"
files-since-master = "!git files-since origin/master && :"
follow = log -n 10 --pretty=format:'%Cred%h%Creset %Cblue%an%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative --full-history --follow --
hide = update-index --assume-unchanged
ignored = !git ls-files -v | grep "^[[:lower:]]"
last = log -n 1 -p --color
# list all branches with their last commit
lb = for-each-ref --sort='-authordate:iso8601' --format='%(if)%(HEAD)%(then)* %(else) %(end)%(if)%(HEAD)%(then)%(color:red)%(refname:short)%(color:reset)%(else)%(color:cyan)%(refname:short)%(end)%(color:reset) - %(subject)%(color:green) %(align:16,left)(%(authordate:relative))%(color:reset)%(end)' refs/heads
# last 5 commits with changed files
lf = log --decorate --pretty=oneline --abbrev-commit --name-status --color -n 5
# last 10 commits without changed files
lg = log --pretty=format:'%Cred%H%Creset %Cblue%an%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --date=relative -n 10
ls-ignored = ls-files --exclude-standard --ignored --others
mf = merge --no-ff
news = log -p HEAD@{1}..HEAD@{0}
next = !git checkout `git rev-list HEAD..master | tail -1`
pb = pull --rebase
pick = cherry-pick
pl = pull
prev = checkout @^
ps = push
rbm = !sh -c 'git fetch origin && git rebase -i origin/master' -
rbu = !sh -c 'git fetch upstream && git rebase -i upstream/master' -
sb = show-branch
show-next = !git show `git rev-list HEAD..master | tail -1`
show-prev = !git show @^
st = status
uncommit = !git reset --soft HEAD^ && git reset HEAD .
unhide = update-index --no-assume-unchanged
unstage = reset HEAD .
# ss = stash save
# sl = stash list -p --color
# sp = status --porcelain
# standup = shortlog --since=yesterday
# svn-pb = svn rebase
# svn-ps = svn dcommit
# svn-pull = svn fetch
# svn-push = svn dcommit
# today = shortlog --since=midnight
# wdiff = diff --word-diff
who = shortlog -s -n --no-merges
[color]
ui = auto
diff = auto
status = auto
branch = auto
interactive = auto
[commit]
gpgsign = true
[core]
excludesfile = ~/.gitignore
pager = less -FRX
editor = vim
autocrlf = input
safecrlf = true
whitespace = cr-at-eol
preloadindex = true
fsmonitor = true
deltabasecachelimit = 4g
sshCommand = ssh -i ~/.ssh/id_rsa
[diff]
compaction-heuristic = true
colorMoved = zebra
algorithm = patience
noprefix=true
[grep]
linenumber = true
[i18n]
commitEncoding = utf8
logOutputEncoding = utf8
[include]
path = .gitconfig.work
[merge]
tool = vimdiff
conflictstyle = diff3
summary = true
[pager]
diff = diff-so-fancy | less --tabs=1,5 -RFX
show = diff-so-fancy | less --tabs=1,5 -RFX
[push]
default = tracking
[pull]
rebase = true
# [url "git@github.com:"]
# insteadOf = https://github.com/
[safe]
directory = *