-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitconfig
81 lines (66 loc) · 2.3 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
[user]
name = Victor Hallberg
email = [email protected]
[core]
excludesfile = ~/.gitignore
autocrlf = input
pager = diff-so-fancy | less --tabs=4 -RFX
[init]
defaultBranch = main
[rerere]
enabled = true
[rebase]
updateRefs = true
[pull]
rebase = true
[merge]
tool = diffconflicts
[push]
default = current
[color]
branch = auto
diff = auto
interactive = auto
status = auto
ui = auto
[apply]
whitespace = fix
[diff]
renames = copies # Detect copies as well as renames.
[mergetool "diffconflicts"]
cmd = ~/.vim/diffconflicts vim $BASE $LOCAL $REMOTE $MERGED
trustExitCode = true
keepBackup = false
[alias]
main = !git switch $(basename $(git symbolic-ref --short refs/remotes/origin/HEAD))
fix-origin = remote set-head origin --auto
amend = commit --amend
branches = branch -a
cleanup = !git pull --prune --all --ff-only && git cleanup-branches && git remote prune origin && git cleanup-stashes
cleanup-branches = !git branch --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" { print $1 }' | xargs -r git branch -D
cleanup-stashes = !git stash list --before 180.days.ago --pretty='%gd %s' | grep ' WIP on ' | tac | cut -d ' ' -f 1 | xargs -n1 git stash drop
cp = cherry-pick
discard = checkout --
pushf = push --force-with-lease
precommit = diff --cached --diff-algorithm=minimal -w
rc = rebase --continue
refs-by-age = for-each-ref --sort=-committerdate refs/remotes --format='%(HEAD) %(color:red)%(refname:short)%(color:reset) (%(color:blue)%(committerdate:relative)%(color:reset)) - %(contents:subject) - %(authorname)'
stash-staged = "!bash -c \"git stash --keep-index; git stash push -m 'staged' --keep-index; git stash pop stash@{1}\""
stashes = stash list --pretty='%C(red)%gd %C(reset)%s %C(blue)(%ar)%C(reset)'
sync = !git main && git cleanup
tags = tag
uncommit = reset --mixed HEAD~
unstage = reset -q HEAD --
[diff-so-fancy]
markEmptyLines = false
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[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