-
Notifications
You must be signed in to change notification settings - Fork 7
/
gitconfig
119 lines (104 loc) · 3.42 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
[user]
name = Ben Radler
email = [email protected]
signingkey = E74A08D2
[github]
user = lordnibbler
token = GithubToken
[alias]
# basic aliases
co = checkout
ci = commit
rb = rebase
br = branch
st = status
br = branch
df = diff
cp = cherry-pick
fp = push --force-with-lease
recommit = commit --amend -CHEAD
reci = commit --amend -CHEAD
staged = diff --cached
pp = pull --prune
# shows the current git branch
current-branch = rev-parse --symbolic-full-name --abbrev-ref HEAD
# set current branch to the upstream, and creates it on the remote
shove = "!f() { H=$(git current-branch) && git push -u origin $H; }; f"
# pretty log
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
# grep
g = grep --break --heading --line-number
# grep everything
gg ="!f() { git rev-list --all | xargs git grep $1; }; f"
# sets upstream to your current symbolic-ref (HEAD)
pub = "!f() { git push -u ${1:-origin} `git symbolic-ref HEAD`; }; f"
# shows the first parent
ancestor = !bash -c 'diff --old-line-format= --new-line-format= <(git rev-list --first-parent \"${1:-master}\") <(git rev-list --first-parent \"${2:-HEAD}\") | head -1' -
# show the last n commits
last = log -n
current-remote = "!f() { B=$(git config branch.$(git current-branch).remote) && echo ${B/./refs/heads}; }; f"
current-merge = "!f() { B=$(git config branch.$(git current-branch).merge) && echo ${B#refs/heads/}; }; f"
current-track = "!f() { R=$(git current-remote) && M=$(git current-merge) && echo ${R}/${M}; }; f"
incoming = "!f() { T=$( [ \"${1}\" == \"\" ] && echo $(git current-track) || echo ${1} ) && git log ..${T} $@; }; f"
outgoing = "!f() { T=$( [ \"${1}\" == \"\" ] && echo $(git current-track) || echo ${1} ) && git log ${T}.. $@; }; f"
# delete all local branches merged into master, develop
cleanup = "!git branch --merged | grep -v '\\*\\|master\\|develop' | xargs -n 1 git branch -d"
# delete ALL local branches, merged or not
cleanupall = "!git branch | xargs -n 1 | grep -v master | grep -v "*" | xargs -n 1 git branch -D"
# list branches not merged into currently checked out branch
wip = branch --no-merged
# list branches merged into currently checked out branch
done = branch --merged
# Hub gem
pr = pull-request
ctags = !.git/hooks/ctags
[color]
ui = auto
[color "branch"]
current = yellow reverse
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
[color]
ui = true
[color "diff"]
whitespace = red reverse
[core]
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[apply]
whitespace = fix
[branch]
autosetupmerge = always
autosetuprebase = always
[push]
default = simple
[rerere]
enabled = true
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[diff]
tool = Kaleidoscope
[difftool]
prompt = false
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
[mergetool]
prompt = false
[merge]
tool = Kaleidoscope
[init]
templatedir = ~/.dotfiles/git_template
[gpg]
program = /opt/homebrew/bin/gpg
[commit]
gpgsign = true