-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitconfig
More file actions
150 lines (120 loc) · 3.58 KB
/
Copy pathgitconfig
File metadata and controls
150 lines (120 loc) · 3.58 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
[alias]
co = checkout
cob = checkout -b
delete-local-branch = branch -d
delete-remote-branch = branch -D
discard = reset HEAD --hard
gr = grep -Ii
log-pretty = log --graph --oneline --decorate --all
pushmr = push -o merge_request.create
pushmrf = push -f -o merge_request.create
rebase-i-master = "!git rebase -i `git merge-base master HEAD`"
rebase-i-main = "!git rebase -i `git merge-base main HEAD`"
rm-untracked = clean -df
search-commits = "!git rev-list --all | xargs git grep -F"
stash-all = stash --all
st = status -s -b --show-stash
reset-hard = "!git reset --hard"
undo = reset HEAD~1 --mixed
ci = commit --edit
amend = commit --amend --no-edit
edit = commit --amend --only
delete-local-merged = "!git fetch && git branch --merged | egrep -v 'master|dev|main|staging' | xargs git branch -d"
# lifted from https://github.com/nedbat/dot/blob/master/.config/git/config
fa = fetch --all --prune --tags
pa = "!f() { git push --all; git push --tags; }; f"
# Get a plain-text diff, for making patches.
patch = "!f() { git --no-pager diff --no-color $@; }; f"
# Find the name of the primary branch, either "main" or "master".
primary = "!f() { \
git branch -a | \
sed -n -E -e '/remotes.origin.ma(in|ster)$/s@remotes/origin/@@p'; \
}; f"
# Switch to main or master, whichever exists, and update it.
ma = "!f() { \
git checkout $(git primary) && \
git pull; \
}; f"
# Switch to the origin's default branch, like ma, but more accurate and slower.
oma = "!f() { \
git checkout \
$(\
git remote show origin | \
sed -n -E -e '/HEAD branch/s/.*: //p' \
) && \
git pull; \
}; f"
# Pull the upstream main/master branch and update our fork.
mma = "!f() { \
git ma && \
git pull upstream $(git primary) --ff-only && \
git push; \
}; f"
# Merge a branch, and delete it here and on the origin.
brmerge = "!f() { \
: git show; \
git merge $1 && \
git branch -d $1 && \
git push origin --delete $1; \
}; f"
# Merge the branch we just switched from.
brmerge- = "!f() { \
git brmerge $(git rev-parse --abbrev-ref @{-1}); \
}; f"
# I'm done with this merged branch, ready to switch back to another one.
brdone = "!f() { \
: git show; \
local brname=\"$(git symbolic-ref --short HEAD)\" && \
local primary=\"$(git primary)\" && \
git checkout ${1:-$primary} && \
git pull && \
git branch -d $brname && \
git push origin --delete $brname; \
}; f"
# A list of conflicted files.
flict = "!f(){ git ls-files -u | awk '{print $4}' | sort -u; }; f"
[user]
email = dirk@dirkgomez.de
name = Dirk Gómez
[core]
precomposeunicode = true
excludesfile = /Users/dirk/.gitignore_global
[color]
ui = true
[fetch]
prune = true
pruneTags = true
all = true
[pull]
rebase = true
[push]
autoSetupRemote = true
default = simple
followTags = true
[merge]
conflictstyle = zdiff3
[rerere]
enabled = true
autoupdate = true
[status]
submoduleSummary = true
[diff]
submodule = log
algorithm = histogram
colorMoved = plain
mnemonicPrefix = true
renames = true
[init]
defaultBranch = main
[tag]
sort = version:refname
[column]
ui = auto
[branch]
sort = -committerdate
[help]
autocorrect = prompt
[commit]
verbose = true
[includeIf "gitdir:~/Documents/Code/work/"]
path = ~/Documents/code/work/.gitconfig