-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
100 lines (78 loc) · 2.79 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
[init]
defaultBranch = main
# set your user tokens as enivornment variables, such as ~/.secrets
# See the README for examples.
[color]
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red
new = green
[credential]
helper = osxkeychain
[alias]
# Utilities
current = rev-parse --abbrev-ref HEAD # prints your current branch name
user-key = "!f() { git config --get user.$1; }; f" # Fetches a value from your .gitconfig.user values
mine = ! git log --author="$(git user-key name)" # show my commits
primary = git remote show origin | sed -n '/HEAD branch/s/.*: //p'
# Faves
reset-primary = "!f() { git checkout $(git primary) && git fetch origin $(git primary) && git reset --hard origin/$(git primary) }; f" # checks out primary and resets it to latest
reset-branch = "!f() { branch=$(git current); git fetch origin $branch; git reset --hard origin/$branch; }; f"
rebase-primary = "!f() { git fetch origin $(git primary) && git rebase origin/$(git primary) }; f"
kill = "!f() { branch=$(git current); git reset-master; git b -D $branch; }; f" # kill the current branch and reset to latest dev
kill-to-base = "!f() { branch=$(git current); git reset-base; git b -D $branch; }; f" # kill the current branch and reset to latest base branch
uncommit = reset --soft HEAD^ # remove the last commit, but keep the changes staged
stuff = commit --amend -C HEAD # Pushes your currently added changes into the previous commit
cleanup = !git branch --merged | grep -v 'master\\|main\\|production\\|staging' | xargs -n 1 git branch -d
[format]
pretty = format:%C(blue)%ad%Creset %C(yellow)%h%C(green)%d%Creset %C(cyan bold)%s %C(magenta) [%an]%Creset
[pager]
branch = false
[mergetool]
prompt = false
[mergetool "vimdiff"]
cmd="vim -c 'Gdiff' $MERGED" # use fugitive.vim for 3-way merge
keepbackup=false
[merge]
summary = true
verbosity = 1
tool = mvimdiff
[apply]
whitespace = nowarn
[branch]
autosetupmerge = true
[push]
# 'git push' will push the current branch to its tracking branch
# the usual default is to push all branches
default = tracking
[core]
autocrlf = false
editor = vim
excludesfile = ~/.gitignore_global
[advice]
statusHints = false
[diff]
# Git diff will use (i)ndex, (w)ork tree, (c)ommit and (o)bject
# instead of a/b/c/d as prefixes for patches
mnemonicprefix = true
algorithm = patience
[rerere]
# Remember my merges
# http://gitfu.wordpress.com/2008/04/20/git-rerere-rereremember-what-you-did-last-time/
enabled = true
autoupdate = true
[include]
path = .gitconfig.user
[filter "lfs"]
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
[commit]
gpgsign = true