-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
113 lines (113 loc) · 4.2 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
[user]
name = Andreas Lindhé
[alias]
a = add -p
al = "!git config alias.${1:?} #"
ado = "log -q --pretty='format:%B'"
bi = bisect
bra = branch -vv
branch-age = "!git for-each-ref --sort=-committerdate refs/heads --format=\"%(refname:short)|%(committerdate:relative)\" | column -ts \"|\""
bras = for-each-ref --sort=-committerdate refs/heads --format='%(refname:short)|%(committerdate:relative)'
c = commit -v
ca = commit -av
cap = commit -vp
change = commit --amend -v
cl = clone
cm = commit -m
co = checkout
cp = cherry-pick
default-branch = "!~/git/lindhe/scripts/git/git-default-branch.sh"
df = diff --ignore-space-change --color-words='\\w+|.'
dff = diff --ignore-space-change --color-words='.'
dfff = diff --ignore-space-change --word-diff-regex='.'
email = "!git config --local user.email ${1:-${GIT_AUTHOR_EMAIL}} #"
files-in = diff-tree --no-commit-id --name-only -r
fix = "!git branch ${1:?} $(git default-branch) && git nwt ${1:?} #"
fixup = "!git rebase -i $(git mb) #"
get = "!~/git/lindhe/scripts/git/git-get.py"
get-gone = "!git branch -av | grep '\\[gone]' #"
gh = "!git clone https://github.com/${1}.git #"
h = help
l = log --oneline
ll = "!git l $(git mb)~1.."
lb = "!git log --oneline --graph --color=always $(git mb)~1.. $(git default-branch) HEAD"
lob = log --oneline --graph --branches --color=always
mb = "!git merge-base origin/$(git default-branch) HEAD"
nb = "!git switch -c lindhe/${1:?} #"
nuke-branch = "!git worktree remove ${*} && git branch -D ${*} #"
nwt = "!WTD=~/git/worktree/${1:?}; (git branch -l ${1:?} | grep -q ${1:?}) || echo ERROR: Branch ${1:?} not found 1>&2 && mkdir -p ${WTD} && git worktree add ${WTD} ${1:?} && echo ${WTD} #"
new = diff --cached --color-moved=zebra
nw = diff --cached --ignore-space-change --color-words='\\w+|.'
nww = diff --cached --ignore-space-change --color-words='.'
nwww = diff --cached --ignore-space-change --word-diff-regex='.'
pl = "!git pull && git log -- ORIG_HEAD..origin/$(git branch --show-current) #"
push-ref = "!git push origin ${1:?}:$(git default-branch) #"
pushf = push --force-with-lease
psuh = push
reb = rebase
rem = remote -v
remove-gone = "!git branch -av | grep -E '^[^\\+].*\\[gone]' | awk '{ print $1 }' | xargs git branch -D #"
review = "!git diff --color-moved=zebra $(git merge-base $(git default-branch) HEAD)..HEAD"
revieww = review --color-words='\\w+|.'
root = rev-parse --show-toplevel
s = status
shw = show --ignore-space-change --color-words='\\w+'
shww = show --ignore-space-change --color-words='.'
shwww = show --ignore-space-change --word-diff-regex='.'
sorry = commit --amend --no-edit
st = status
sw = "!from=\"$(git branch --show-current)\"; git switch ${@:-$(git default-branch)} && (echo \"Old branch was ${from:?}\"; git diff --stat $(git default-branch)...) #"
sww = "!git stash && git sw ${@} && git stash pop #"
sync = "!git fetch upstream && git reset --hard upstream/$(git branch --show-current) #"
track = "!git branch --set-upstream-to=${1:-origin}/$(git branch --show-current) $(git branch --show-current) #"
unstage = restore --staged -p
update = "!git fetch origin $(git default-branch):$(git default-branch)"
wtf = log -- ORIG_HEAD..HEAD
whatchanged = log -- ORIG_HEAD..HEAD
whats = "!git config alias.${1:?} #"
wt = worktree
[branch]
autosetuprebase = always
[pull]
rebase = true
[core]
attributesfile = ~/.gitattributes_global
excludesfile = ~/.gitignore_global
quotepath = off
[push]
default = current
autoSetupRemote = true
[color]
status = always
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
process = git-lfs filter-process
[fetch]
prune = true
[diff "sopsdiffer"]
textconv = sops -d
[rerere]
enabled = true
[credential "https://dev.azure.com"]
useHttpPath = true
[include]
path = ~/.config/git/local.gitconfig
[include]
path = ~/.config/git/wsl.gitconfig
[include]
path = ~/.config/git/work.gitconfig
[includeIf "hasconfig:remote.*.url:[email protected]:*/*"]
path = ~/.config/git/github.gitconfig
[includeIf "hasconfig:remote.*.url:https://github.com/**"]
path = ~/.config/git/github.gitconfig
[init]
defaultBranch = master
[log]
decorate = short
initialDecorationSet = all
[rebase]
autoSquash = true
autoStash = true
updateRefs = true