forked from mkjmdski/.dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal.gitconfig
128 lines (106 loc) · 3.45 KB
/
global.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
#### STANDARD SETTINGS
[core]
# Don't consider trailing space change as a cause for merge conflicts
whitespace = -trailing-space
# Use vim as default editor
editor = vim
# Use GUI editors
# editor = code --wait
# editor = subl -n -w
# editor = atom --wait
#### COLORS DEFINITIONS
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
#### COMMAND SETTINGS
[log]
# Use abbrev SHAs whenever possible/relevant instead of full 40 chars
abbrevCommit = true
[push]
# When pushing, also push tags whose commit-ishs are now reachable upstream
followTags = true
[tag]
# Sort tags as version numbers whenever applicable, so 1.10.2 is AFTER 1.2.0.
sort = version:refname
[pull]
#always rebase and stash before pulling
rebase = true
[status]
# show branch and stash
branch = true
showStash = true
[rebase]
autoStash = true
instructionFormat = %s [%an]
[sequence]
editor = interactive-rebase-tool
#### MERGETOOLS
# PyCharm
# [merge]
# tool = pycharm
# [mergetool "pycharm"]
# cmd = /usr/local/bin/charm merge "$LOCAL" "$REMOTE" "$BASE" "$MERGED"
# VIM
[merge]
tool = vimdiff
conflictstyle = diff3
[mergetool "vimdiff"]
prompt = false
#### DIFF TOOLS
[diff]
renames = true
tool = icdiff
# tool = pycharm
[difftool]
prompt = false
[difftool "icdiff"]
cmd = icdiff --line-numbers $LOCAL $REMOTE
# [difftool "pycharm"]
# cmd = /usr/local/bin/charm diff "$LOCAL" "$REMOTE" && echo "Press enter to continue..." && read
#### ALIASES
[alias]
p = "!f(){ git push || (git pull && git push) ; }; f"
a = add --all
m = commit --message
cam = "!f(){ git a && git commit -m \"$1\" ; }; f"
amp = "!f(){ git add -A && git commit -m \"$@\"; git p ; }; f"
mp = "!f(){ git commit -m \"$@\"; git p ; }; f"
merge-me = "!f(){ b=$(git current-branch); git checkout ${1:-master}; git merge $b; }; f"
s = status
annotate-tag = "!f(){ tag=\"$(git describe --tags)\"; git delete-tag $tag; git tag -a $tag -m \"$(git show -s --format=%s)\"; git p ; }; f"
st = stash save --include-untracked
pop = stash pop
push-u = "!f(){ git push -u ${1-origin} $(git current-branch) ; }; f"
amend = commit --amend --no-edit
force = push --force-with-lease
log-line = log --pretty=format:\"%C(yellow)%h %ar %C(auto)%d %Creset %s, %Cblue%cn\" --graph --all
uncommit = reset HEAD~
unstage = reset HEAD
current-branch = "rev-parse --abbrev-ref HEAD"
# show changed dirs
dirs = "!f(){ git diff --dirstat=files,0 | awk '{print $2}' | sort | uniq ; }; f"
overwrite = !git a && git amend && git force
merge-rebase = "!f() { actual=$(git current-branch) && git checkout $1 && git rebase $actual && git force && git checkout $actual && git merge $1 ; }; f"
squash-branch = "!f() { git reset $(git merge-base ${2:-master} $(git current-branch)) ; git a ; git m ${1:-$(git log -1 --pretty=%B)} ; }; f"
is-clean = "!f() { if ! git diff --exit-code &> /dev/null || [[ ! -z "$(git ls-files --other --directory --exclude-standard)" ]]; then exit 1; fi ; }; f"
rebase-main = "!f() {b="$(git current-branch)"; git checkout ${1:-master}; git pull; git checkout $b; git rebase ${1:-master} ; }; f"
message = "log -1 --pretty=%B"
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[includeIf "gitdir:~/repos/karhoo/**"]
path = .gitconfig-work