-
Notifications
You must be signed in to change notification settings - Fork 21
/
.gitconfig
98 lines (88 loc) · 3.18 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
[user]
name = Brandon Rhodes
email = [email protected]
[alias]
a = add -AN
at = rev-parse HEAD
abandon = !b="$(git symbolic-ref --short HEAD)" && [ "$b" != "master" ] && git checkout master && git branch -D "$b"
abort = merge --abort
amend = commit --amend --no-edit
atag = !bash -c 'git tag -a \"$@\" && git push --tags' --
base = merge-base HEAD origin/master
br = "!if [ -n \"$1\" ] ;then git branch \"$@\" ;else git for-each-ref --sort=committerdate refs/heads/ --format=\"%(HEAD) %(color:yellow)%(objectname:short)%(color:reset) %(refname:short) (%(color:green)%(committerdate:relative)%(color:reset))\" ;fi ;:"
cherry-apply = !git cherry-pick --no-commit --allow-empty "$@" && git reset HEAD
ci = commit -v
co = checkout
cleanup = clean -dfx -e .vagrant
d = diff
diff-vs = !git diff -M $(git merge-base HEAD "${1:-main}") -- .
edit = commit --amend --only
h = !man gitrevisions
fetch-pull-request = !git fetch origin pull/$1/head:pull-$1
ff = merge --ff-only
hard = reset --hard
harder = !git hard && git clean -f -d
incoming = remote show origin
l = log --graph --pretty=oneline --abbrev-commit --decorate=short
la = log --graph --pretty=oneline --abbrev-commit --decorate=short --branches --tags --remotes
ll = log --graph --date=short --pretty='%Cgreen%h %Cblue%cd%Creset %s'
lp = -c pager.log='LESSHISTFILE=- less --pattern=^CommitDate:' log -p --pretty=fuller
ls = log --stat --pretty=fuller
patch = commit --patch -v
merge-abort = merge --abort
mine = !cd ${GIT_PREFIX:-.} && git log --stat --pretty=fuller --author="$(git config user.email)"
rmb = "!f(){ \
for b in \"$@\"; \
do for r in $(git show-ref $b | awk '{print $2}'); \
do echo $r; \
if echo $r | grep -q '^refs/remotes/'; \
then echo $r | sed 's:refs/remotes/::;s:/: :' \
| xargs -n2 git push --delete ; \
fi; \
git update-ref -d $r; \
done; \
done; \
};f"
score = diff --shortstat
score-vs-master = !git diff --shortstat $(git merge-base HEAD origin/master) -- .
show-paths = show --pretty="" --name-only
soft = reset HEAD .
squash = !git reset --soft $(git merge-base HEAD origin/master) && git ci
st = status
stash-dammit = stash --include-untracked
tags = tag -l --sort=creatordate --format='%(creatordate:short) %(refname:short)'
undo = !git reset --soft HEAD~1 && git reset HEAD .
unstage = restore --staged .
up = fetch origin master:master
who = "!f () { \
git log --date='format:%Y-%m' --format='%cd %ae' --since=1.year $@ \
| sort | uniq -c | awk '{printf(\"%s %4s %s\\n\",$2,$1,$3)}' \
| sort -n \
| awk '{t=\"\";if($1!=m)m=t=$1;printf(\"%7s %4s %s\\n\",t,$2,$3)}' ; \
}; f"
wdiff = diff --color-words=.
[core]
pager = less -FRX
excludesfile = ~/.gitexcludes
[color]
branch = auto
diff = auto
interactive = auto
status = auto
[diff]
noprefix = true
[fetch]
prune = true
[filter "sshconfig_trailer"]
clean = sed '/^. Everything below will be ignored by git.$/q'
[merge]
conflictstyle = diff3
tool = meld
[mergetool "meld"]
# Choose one of these 2 lines (not both!) explained below.
cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED"
#cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED"
[push]
default = current
[include]
path = .gitlocal