-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_gitconfig
More file actions
149 lines (125 loc) · 5 KB
/
dot_gitconfig
File metadata and controls
149 lines (125 loc) · 5 KB
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
[user]
name = Matt Odille
useConfigOnly = true
email = matt.odille@gmail.com
[github]
user = modille
[alias]
br = "!f() { count=$1; git branch --all --sort=-committerdate --color=always --format='%(color:green)%(committerdate:relative)|%(color:reset)%(color:bold)%(refname:short)|%(color:reset)%(color:blue)%(subject)' | head -n ${count:-20} | column -ts'|'; }; f"
branchauthors = "! for branch in `git branch -r | grep -v /HEAD`;do echo `git show --format=\"%ai %ar by %an\" $branch | head -n 1` \t$branch; done | sort -r"
discard-unstaged = checkout -- .
discard-untracked = clean -d --force
get = "!f() { \
repo_host=`echo $1 | cut -d '/' -f1`; \
repo_path=`echo $1 | cut -d '/' -f2-`; \
git clone git@$repo_host:$repo_path ~/git/$repo_host/$repo_path; \
echo ~/git/$repo_host/$repo_path; \
}; f"
l = log --abbrev-commit --decorate
lg = log --abbrev-commit --decorate --graph --stat
lgp = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
lr = log --remotes --no-walk --oneline
nuke = !git reset --hard HEAD && git clean -d --force
push-up = push --set-upstream origin
reset-hard = reset --hard HEAD^
reset-soft = reset --soft HEAD^
rpo = remote prune origin
rr = for-each-ref --format='%(refname:strip=3)' refs/remotes
# Alias praise to blame, and use vim for colorized blame
praise = "!f() { nvim -c 'Gblame' $1; }; f"
# https://csswizardry.com/2017/05/little-things-i-like-to-do-with-git/
recent-branches = for-each-ref --count=10 --sort=-committerdate refs/heads/ --format="%(refname:short)"
all-since = "!f() { git log --all --oneline --no-merges --since=\"$1\" --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'; }; f"
me-since = "!f() { git log --all --oneline --no-merges --since=\"$1\" --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --author=$GIT_AUTHOR_EMAIL; }; f"
word-diff = diff --word-diff
char-diff = diff --word-diff-regex="."
upstream = log --abbrev-commit --decorate HEAD..origin/
# http://gggritso.com/human-git-aliases
branches = branch -a
discard = checkout --
remotes = remote -v
stashes = stash list
tags = tag
unstage = reset HEAD --
# list files which have changed since REVIEW_BASE
# (REVIEW_BASE defaults to 'origin/develop' in my zshrc)
files = "!f() { git diff --name-only $(git merge-base HEAD \"$REVIEW_BASE\") \":(exclude)package-lock.json\" \":(exclude)features/auto_mocks/*\"; }; f"
# Same as above, but with a diff stat instead of just names
# (better for interactive use)
stat = "!f() { git --no-pager diff --stat $(git merge-base HEAD \"$REVIEW_BASE\") \":(exclude)features/support/__recordings__/*\" \":(exclude)features/auto_mocks/*\"; }; f"
# ignore test files
statsrc = "!f() { git --no-pager diff --stat $(git merge-base HEAD \"$REVIEW_BASE\") \":(exclude)features/*\" \":(exclude)spec/*\" \":(exclude)*/__tests__/*\" \":(exclude)*/__mocks__/*\"; }; f"
# Visualizing relationships between files
# git depgraph | imgcat
; depgraph = !git madge image --basedir . --exclude \".*_spec\\.js\" --exclude \".*__mocks__/*\" --style solarized-light src
depgraph = "!f() { git madge image --basedir . --style solarized-light src; }; f"
# Open all files changed since REVIEW_BASE in Vim tabs
# Then, run fugitive's :Gvdiffsplit in each tab
review = "!f() { nvim -p $(git files) +\"tabdo Gvdiffsplit $REVIEW_BASE\"; }; f"
# Same as the above, except specify names of files as arguments,
# instead of opening all files:
# git reviewone foo.js bar.js
reviewone = "!f() { nvim -p +\"tabdo Gvdiffsplit $REVIEW_BASE\"; }; f"
[color]
ui = auto
[color "diff"]
commit = green
frag = blue
meta = blue bold
new = green
old = red
whitespace = red reverse
[color "diff-highlight"]
newHighlight = "green 22"
newNormal = green
oldHighlight = "red 52"
oldNormal = red
[color "status"]
added = green
changed = yellow
untracked = red
[commit]
verbose = true
[core]
autocrlf = input
editor = nvim
excludesfile = ~/.gitignore
pager = delta
[diff]
guitool = diffmerge
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[gitsh]
noGreeting = true
[init]
defaultBranch = main
[interactive]
diffFilter = delta --color-only
[mergetool]
keepBackup = false
prompt = false
[pull]
ff = only
[push]
default = current
autoSetupRemote = true
[status]
submoduleSummary = true
[transfer]
fsckobjects = true
# Generated by:
# nbdime config-git --enable --global
[diff "jupyternotebook"]
command = git-nbdiffdriver diff
[merge "jupyternotebook"]
driver = git-nbmergedriver merge %O %A %B %L %P
name = jupyter notebook merge driver
[difftool "nbdime"]
cmd = "git-nbdifftool diff \"$LOCAL\" \"$REMOTE\" \"$BASE\""
[difftool]
prompt = false
[mergetool "nbdime"]
cmd = "git-nbmergetool merge \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\""