-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgitconfig
151 lines (134 loc) · 4.08 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# -*- mode: Conf; -*-
[user]
name = Simon Conseil
email = [email protected]
[core]
editor = vim +0
excludesfile = ~/.gitignore
commitGraph = true
# autocrlf = input
# safecrlf = true
[alias]
br = branch
co = checkout
cp = cherry-pick
rb = rebase
st = status -sb
tags = tag -l
ls = ls-files
ignored = ls-files --others
ci = commit -v
unci = reset HEAD^
uncommit = reset HEAD^
unstage = reset HEAD --
amend = commit --amend --no-edit
fixup = commit --fixup
squash = commit --squash
# log
authorcount = shortlog -sn --no-merges
authors = "!git log --format='%aN <%aE>' | sort -u"
logs = log --stat
logv = log --patch-with-stat
oneline = log --graph --all --abbrev-commit --decorate --pretty=oneline
hist = log --graph --all --pretty=format:'%C(auto)%h%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)[%an]%Creset'
gflog = log -p --cc --graph --decorate
# Credit an author on the latest commit
credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
# summary of what you're going to pull/push
in = !git fetch --all && git hist origin/master
out = log --oneline --graph origin/master..HEAD
sync = !git stash && git pull && git new && git stash pop
fa = fetch -v --all --progress
# see what new commits have been created by the last command (typically after a "git pull")
new = !sh -c 'git log $1@{1}..$1@{0} "$@"'
# diff
di = diff
staged = diff --cached
diffs = diff --stat -r
diffw = diff --word-diff=color
showw = show --word-diff=color
# info
remotes = remote -v
# push new branch
pushb = !git push -u origin $(git rev-parse --abbrev-ref HEAD)
# fires up a git daemon for the repo you are currently in
serve = daemon --verbose --export-all --base-path=.git --reuseaddr --strict-paths .git/
serveall = daemon --verbose --export-all --base-path=. --reuseaddr .
# Prune all your stale remote branches
prune-all = !git remote | xargs -n 1 git remote prune
# Show git branches sorted by latest commit
latest = for-each-ref --sort=-committerdate --format='%(color:green)%(committerdate:relative) %(color:yellow)%(objectname:short) %(color:white)%(refname:short) %(color:blue)%(authorname) %(color:white)%(contents:subject)'
ours = "!f() { git checkout --ours -- $@ && git add -- $@; }; f"
theirs = "!f() { git checkout --theirs -- $@ && git add -- $@; }; f"
# https://gist.github.com/gnarf/5406589 : git pr 123 [upstream]
pr = !git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && :
pr-clean = "!git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done""'"
[diff]
renames = true
algorithm = patience
noprefix = true
[color]
branch = auto
diff = auto
status = auto
interactive = auto
ui = auto
[color "branch"]
current = red bold
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[rebase]
stat = true
autosquash = true
autostash = true
[branch]
autosetupmerge = true
autosetuprebase = always
[push]
default = upstream
[pull]
rebase = merges
[status]
submoduleSummary = true
showUntrackedFiles = all
[merge]
tool = splice
stat = true
[mergetool "gvimdiff3"]
cmd = gvim -f -d -c \"wincmd J\" \"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"
[mergetool "vimdiff3"]
cmd = vim -f -d -c \"wincmd J\" \"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"
[mergetool "splice"]
cmd = "gvim -f $BASE $LOCAL $REMOTE $MERGED -c 'SpliceInit'"
trustExitCode = true
[github]
user = saimn
[include]
path = .gitconfig.local
[fetch]
prune = true
writeCommitGraph = true
[submodule]
fetchJobs = 4
[stash]
showPatch = true
[gc]
writeCommitGraph = true
[init]
defaultBranch = main
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
[include]
path = ~/.gitconfig.local