-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
130 lines (130 loc) · 4.7 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
[user]
name = Patrick Oscity
email = [email protected]
[github]
user = padde
[color]
branch = auto
diff = auto
status = auto
ui = true
[color "diff"]
meta = black bold
frag = magenta
old = red
new = green
commit = yellow
whitespace = red reverse
[color "diff-highlight"]
oldNormal = red
oldHighlight = red ul
newNormal = green
newHighlight = green ul
[color "status"]
added = yellow
changed = green
untracked = blue
[alias]
alias = "!f(){ git config --get alias.$1; }; f"
au = add -u
st = status
ci = commit
br = branch
cine = commit --no-edit --no-verify
co = checkout
df = diff
dfs = diff --staged
export = "!f(){ ref=${1:-HEAD}; outfile=\"$HOME/Desktop/$(basename \"$(pwd)\")-$(git rev-parse --short \"$ref\").tar.gz\"; git archive --format=tar.gz -o \"$outfile\" \"$ref\" && echo \"Exported repo to $outfile\"; }; f"
last = show HEAD~1..HEAD
log-pretty = log --pretty='%C(blue)%h %C(green)%aN %C(yellow)%s%C(red)%d %C(blue)%ar%Creset' --graph
lgp = "!git log-pretty"
lgg = "!git log-pretty --first-parent"
l = "!git log-pretty --first-parent -n10"
up = "!git set-upstream"
obsolete = "!git branch --merged | grep -v \"\\\\*\\\\|master\\\\|$(git symbolic-ref --short HEAD)\""
gone = "!git branch -vv | grep ': gone]' | awk '{print $1}'"
touch = "commit --amend --no-edit --no-verify --date=now --reset-author"
trim-remote = fetch --prune --all
trim-obsolete = "!git obsolete | xargs git branch -d"
trim-gone = "!git gone | xargs git branch -D"
trim = "!git trim-remote && git trim-obsolete && git trim-gone && git pull"
giveup = "!printf 'Do you really want to discard all staged, unstaged and untracked changes? [Yn] '; read yn; if [[ $yn =~ "^[yY]([eE][sS])?$" ]]; then (git reset > /dev/null && for f in $(git ls-files -m); do echo "Resetting $f"; done && git co . && git clean -fd); else echo 'aborted'; fi"
authors = "!git shortlog -nes --no-merges"
shame = blame -w -M -C
squash = commit --amend --no-verify --reset-author
fixup = commit --amend --no-edit --no-verify --reset-author
set-upstream = "!git branch --set-upstream-to=origin/$(git rev-parse --abbrev-ref HEAD)"
get-upstream = "!git rev-parse --abbrev-ref --symbolic-full-name @{u}"
get-remote = "!git get-upstream | cut -d/ -f1"
pu-base = "get-upstream"
pu-diff = "!f(){ git diff $* $(git pu-base); }; f"
pu-log = "!f(){ git log-pretty $* $(git pu-base)..HEAD; }; f"
pu-rebase = "!f(){ git rebase $* $(git pu-base); }; f"
pu-grep = "!f(){ git pu-diff --name-only -i -G \"$*\" | xargs rg -i \"$*\" -A 5; }; f"
pud = pu-diff
pul = pu-log
pur = pu-rebase -i
pullall = "!for d in $(find . -type d -iname .git | xargs -I{} dirname {}\\;); do (echo \"Pulling $d... \" && cd $d && git pull --quiet &>/dev/null && echo \"\\033[0;32mOK\\033[0m\" || echo \"\\033[0;31mFAILED\\033[0m\"); done"
pr-base = "!f(){ git merge-base HEAD ${1:-origin/master}; }; f"
pr-diff = "!f(){ git diff $(git pr-base) $*; }; f"
pr-log = "!f(){ git log-pretty $* $(git pr-base)..HEAD; }; f"
pr-rebase = "!f(){ git rebase $* $(git pr-base); }; f"
pr-grep = "!f(){ git pr-diff --name-only -i -G \"$*\" | xargs rg -i \"$*\" -A 5; }; f"
prd = pr-diff
prl = pr-log
prr = pr-rebase -i
rebase = rebase --no-verify
smart-rebase = "!f(){ if [ $# -eq 0 ]; then git pr-rebase -i; else git rebase -i HEAD~$1; fi }; f"
r = smart-rebase
todo = "pr-grep '\\b(todo|fixme|xxx|hack)\\b'"
pick = cherry-pick
mcon = merge --continue
rcon = rebase --continue
refetch = "!git fetch $(git get-remote) && git reset --hard $(git get-upstream)"
wip = "!git add . && git commit --no-verify -m WIP"
unwip = "!if [[ "$(git log HEAD~..HEAD --format='%s')" == "WIP" ]]; then git reset HEAD~1; else echo "Not a WIP commit"; fi"
first-child = "!f(){ c=${1:-HEAD}; set -- $(git rev-list --all --not \"$c\"^@ --children | grep $(git rev-parse \"$c\") ); shift; echo $1; }; f"
next = "!git checkout $(git first-child)"
prev = "!git checkout HEAD~1"
go = "!f(){ git checkout $(git branch -l \"*$1*\" --format '%(refname:short)' | head -n1); }; f"
[core]
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
quotepath = false
pager = cat
[push]
default = current
followTags = true
[pull]
tags = true
ff = only
[help]
autocorrect = 20
[include]
path = ~/.gitconfig.local
[mailmap]
file = ~/.mailmap
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[merge "pofile"]
name = Gettext merge driver
driver = git merge-po %O %A %B
[diff]
algorithm = histogram
[hub]
protocol = https
[rerere]
enabled = true
[credential]
helper = osxkeychain
helper =
helper = /usr/local/share/gcm-core/git-credential-manager
[init]
defaultBranch = main
[fetch]
prune = true
[credential "https://dev.azure.com"]
useHttpPath = true