-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
149 lines (147 loc) · 5.29 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
[core]
quotePath = false
[user]
name = Tomoki Aonuma
email = [email protected]
signingKey = ~/.ssh/id_ed25519_signing.pub
[includeIf "gitdir:~/repos/ghe.ckpd.co/"]
path = ~/.gitconfig.work
[url "[email protected]:"]
pushInsteadOf = https://github.com/
[alias]
addf = !"git status --porcelain | grep '^.[^ ]' | fzf --tac --multi --exit-0 | sed 's!^...!:/!' | tr '\\n' '\\0' | xargs -0 git add -v --"
amend = commit --amend
b = branch
bl = branch --format=%(refname:short) --list
base = !sh -c 'git merge-base ${1:-master} HEAD' -
backup-index = !"cp \"`git rev-parse --git-dir`/index\" \"`git rev-parse --git-dir`/index.bak\""
realclean = clean -x -d
c = commit
ci = commit -m
cia = commit -a -m
recommit = commit -c ORIG_HEAD
co = checkout
com = !git checkout "$(git guess-default-branch)"
copr = pr-checkout
dh = diff HEAD
dh1 = diff HEAD^
dh2 = diff HEAD^^
dh3 = diff HEAD^^^
dhc = diff --color-words HEAD
dh1c = diff --color-words HEAD^
dh2c = diff --color-words HEAD^^
dh3c = diff --color-words HEAD^^^
di = diff
dic = diff --color-words
dis = diff --staged
disc = diff --staged --color-words
dm = diff master
fix = fixup
fp = format-patch --stdout
genesis = hash-object -t tree /dev/null
leaderboard = shortlog -s -n
gg = grep
l = log --decorate
ll = log --decorate --stat
lg = log --graph --decorate --oneline --color
ls-skipped = !"git ls-files -v | grep '^[Sa-z]'"
ls-untracked = ls-files --others --exclude-standard
ls-unusualbits = !"git ls-files -v | grep '^[a-zS]'"
ff = merge --ff-only
m = merge --no-ff
password = !"security find-internet-password -a uasi -s github.com -w | tr -d '\n'"
pbapply = !"{ pbpaste; echo; } | git apply -"
pullff = pull --ff-only
pullr = pull --rebase
pushfl = push --force-with-lease
re = rebase
rea = rebase --abort
rec = rebase --continue
rei = rebase --interactive
reib = !sh -c 'git rebase -i "$(git merge-base ${1:-"$(git guess-default-branch)"} HEAD)"' -
rev = rev-parse --short HEAD
reseth = !git backup-index && git reset --hard
reseth1 = !git backup-index && git reset --hard HEAD^
reseth2 = !git backup-index && git reset --hard HEAD^^
reseth3 = !git backup-index && git reset --hard HEAD^^^
resetm = !git backup-index && git reset --hard master
top = rev-parse --show-toplevel
uncommit = !git backup-index && git reset HEAD^
unstage = !git backup-index && git reset HEAD
unstagef = !"git status --porcelain | grep '^[^ ]' | fzf --multi --exit-0 | sed 's!^...!:/!' | tr '\\n' '\\0' | xargs -0 git unstage --"
unmerge = reset --hard ORIG_HEAD
up = !"git fetch --all && git pull --ff-only && git submodule update && git prune-branches"
sdi = -c core.pager='git-split-diffs --color | less -RFX' diff
sdis = -c core.pager='git-split-diffs --color | less -RFX' diff --staged
setup-origin = !"sh -c 'git remote add origin $1; git config branch.master.remote origin; git config branch.master.merge refs/heads/master' -"
setup-pull-req = config --add remote.origin.fetch '+refs/pull/*/head:refs/remotes/origin/pr/*'
sl = -c core.pager='git-split-diffs --color | less -RFX' log --decorate
submodule-pull = "submodule foreach 'git fetch; git checkout origin/master'"
st = !"git stash list && git status --short --branch"
edit-unmerged = !"$EDITOR `git ls-files --unmerged | cut -f2 | sort -u`"
# GHQ integration
get = !"sh -c 'ghq get \"$@\"' -"
get-readonly = !"sh -c 'GHQ_ROOT=~/repos/readonly ghq get \"$@\"' -"
update = !"sh -c 'ghq import -u local'"
[color]
ui = true
[github]
user = uasi
[merge]
tool = vimdiff
conflictStyle = zdiff3
[mergetool]
keepbackup = false
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[rerere]
enabled = 1
[diff "json"]
textconv = "perl -MJSON -0e \"print JSON->new->canonical->pretty->encode(decode_json(<>))\""
[interactive]
singleKey = true
[rebase]
autoSquash = true
[gc]
rerereResolved = 180
rerereUnresolved = 180
[diff]
algorithm = histogram
indentHeuristic = true
colorMoved = default
[filter "media"]
clean = git-media-clean %f
smudge = git-media-smudge %f
[push]
default = current
recurseSubmodules = check
[ghq]
root = ~/repos
[ghq "import"]
local = "ghq list | sed 's/^/https:\\/\\//'"
[heroku]
account = personal
[grep]
patternType = perl
extendedRegexp = true
[stash]
showPatch = true
[status]
submodulesummary = true
[pull]
ff = only
[advice]
detachedHead = false
[init]
defaultBranch = master
[gpg]
format = ssh
[gpg "ssh"]
allowedSignersFile = ~/.ssh/allowed_signers
[whenmerged "default"]
pattern = '^refs/heads/main$'
pattern = '^refs/heads/master$'