-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.gitconfig
More file actions
120 lines (113 loc) · 4.48 KB
/
.gitconfig
File metadata and controls
120 lines (113 loc) · 4.48 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
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
[color]
diff = auto
status = auto
branch = auto
[core]
whitespace = cr-at-eol
editor = nvim
excludesfile = /Users/petur/.gitignore_global
; pager = delta
;[interactive]
; diffFilter = delta --color-only
;[delta]
; side-by-side = true
;[difftool "sourcetree"]
; cmd = opendiff \"$LOCAL\" \"$REMOTE\"
; path =
; difftastic setup
[diff]
external = difft
[difftool]
prompt = false
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
[pager]
difftool = true
; end of difftastic setup
[http]
sllverify = false
sslverify = false
[user]
name = Petur Subev
email = petur.subev@gmail.com
signingkey = 7FEF56E6
[push]
default = tracking
autoSetupRemote = true
[alias]
spush = push --recurse-submodules=on-demand
supdate = submodule update --remote --rebase
su = submodule update
c = commit -m
co = checkout
a = add
cc = commit --all -m
ca = commit --amend
caa = commit --all --amend
cp = cherry-pick
f = fetch
dic = diff --cached -w
p = pull
pl = pull --rebase
ps = push
s = status
st = status
br = branch
brs = for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
b = branch
out = log origin..HEAD
qpl = log --pretty=\"%Cred%h%Creset %Cgreen[%cr]%Creset %s\" origin/production..origin/master
ls = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset %Cred%an%Creset' --abbrev-commit --date=relative
la = log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset %Cred%an%Creset' --abbrev-commit --date=relative
;ll = log --branches --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset %Cred%an%Creset' --abbrev-commit --date=relative
ll = !git ls origin/$(git rev-parse --abbrev-ref HEAD) HEAD
l = !git ls origin/$(git rev-parse --abbrev-ref HEAD) HEAD
lp = log --all --abbrev-commit --date=relative -p
lsp = log --abbrev-commit --date=relative -p
lastchanges = log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset %Cred%an%Creset' --abbrev-commit --date="relative" --stat
d = diff -w
drop = reset --hard HEAD^
rom = !git fetch && git rebase origin/master
puf = push -f
# === Squash-merge rebase helpers ===
#
# When branch A gets squash-merged into main, and you have branch B that was
# forked from A, GitHub shows conflicts because it tries to re-apply A's commits.
#
# Workflow:
# 1. git parent-candidates # Find which branch B was forked from
# 2. git commits-on-top-of branch-a # Verify which commits are yours
# 3. git rebase-excluding branch-a # Rebase only your commits onto main
#
# commits-on-top-of <branch>: Show commits unique to HEAD after diverging from <branch>
commits-on-top-of = "!f() { git log --oneline $(git merge-base origin/$1 HEAD)..HEAD; }; f"
# rebase-excluding <branch>: Rebase onto main, excluding commits from <branch>
rebase-excluding = "!f() { git rebase --onto origin/main $(git merge-base origin/$1 HEAD); }; f"
# parent-candidates: Find local branches that diverged between main and HEAD
parent-candidates = "!f() { main_base=$(git merge-base origin/main HEAD); for branch in $(git for-each-ref --format='%(refname:short)' refs/heads/ | grep -v \"^$(git rev-parse --abbrev-ref HEAD)$\"); do branch_base=$(git merge-base $branch HEAD 2>/dev/null); if [ -n \"$branch_base\" ] && [ \"$branch_base\" != \"$main_base\" ] && [ \"$branch_base\" != \"$(git rev-parse HEAD)\" ] && git merge-base --is-ancestor $main_base $branch_base 2>/dev/null && git merge-base --is-ancestor $branch_base HEAD 2>/dev/null; then echo \"$branch (diverged at $(git log -1 --format='%h %s' $branch_base))\"; fi; done; }; f"
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
process = git-lfs filter-process
[merge]
autostash = true
tool = gvim
; toggle this to see parent change
conflictstyle = zdiff3
prompt = false
[rerere]
enabled = false
[status]
[mergetool "sourcetree"]
cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[mergetool "mvimdiff"]
cmd = mvim -d \"$LOCAL\" \"$BASE\" \"$REMOTE\"
[pull]
rebase = true
autostash = true
[rebase]
autostash = true
[init]
defaultBranch = main