-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitconfig
More file actions
83 lines (68 loc) · 2.82 KB
/
gitconfig
File metadata and controls
83 lines (68 loc) · 2.82 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
[user]
name = Victor Hallberg
email = victor@hallberg.cc
[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
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
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(green)%>(10)%gd%C(reset) %C(blue)(%as)%C(reset) %s'
branches = for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(align:40)%(color:green)%(refname:short)%(color:reset)%(end) %(align:25)%(color:red)%(authorname)%(color:reset)%(end) %(color:blue)(%(committerdate:short))%(color:reset) %(contents:subject)'
branches-remote = for-each-ref --sort=committerdate refs/remotes --format='%(HEAD) %(align:60)%(color:green)%(refname:lstrip=3)%(color:reset)%(end) %(align:25)%(color:red)%(authorname)%(color:reset)%(end) %(color:blue)(%(committerdate:short))%(color:reset) %(contents:subject)'
sync = !git main && git cleanup
tags = tag
uncommit = reset --mixed HEAD~
unstage = reset -q HEAD --
l = log --color --no-patch --pretty=format:"%C(red)[%h] %an %C(blue)(%ar)%n%C(green)%s%n%b%C(reset)"
lf = log --color --name-status --pretty=format:"%C(red)[%h] %an %C(blue)(%ar)%n%C(green)%s%n%b%C(reset)"
[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