-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_gitconfig_personal
More file actions
68 lines (58 loc) · 1.47 KB
/
dot_gitconfig_personal
File metadata and controls
68 lines (58 loc) · 1.47 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
[user]
name = Rodrigo Muñoz
email = 2280164+rodmk@users.noreply.github.com
[merge]
conflictstyle = zdiff3
[push]
autoSetupRemote = true
[rebase]
autoStash = true
[pull]
rebase = true
[diff]
algorithm = histogram
[alias]
# auto-stage when committing
c = commit -a
cm = commit -a -m
ca = commit -a --amend
can = commit -a --amend --no-edit
uncommit = reset --soft HEAD~1
undo = reset --soft HEAD@{1}
squash-all = "!f() { \
base=${1:-main}; \
merge_base=$(git merge-base HEAD origin/${base}); \
FIRST=$(git rev-list ${merge_base}..HEAD | tail -1); \
[ -z \"$FIRST\" ] && echo 'No commits to squash' && exit 1; \
git reset --soft ${merge_base} && git commit -C $FIRST; \
}; f"
co = checkout
cob = checkout -b
sw = switch
swc = switch -c
rs = restore
rss = restore --staged
discard = restore --staged --worktree
br = branch
brd = branch -d
brD = branch -D
# prune-branches: https://stackoverflow.com/a/47939403
brp = "!f() { \
git fetch --prune; \
branches=$(git for-each-ref --format '%(if:equals=gone)%(upstream:track,nobracket)%(then)%(refname:short)%(end)' refs/heads/); \
[ -z \"$branches\" ] && echo 'No branches to prune' && exit 0; \
git branch --delete --force $branches; \
}; f"
p = push
pf = push --force-with-lease
pl = pull
# pull-rebase
plr = "!f() { \
base=${1:-main}; \
git fetch origin ${base}:${base}; \
git rebase origin/${base}; \
}; f"
d = diff
dc = diff --cached
s = status
l = log --oneline --graph --decorate