/
.gitconfig
75 lines (62 loc) · 1.98 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
[user]
name = Haroen Viaene
email = hello@haroen.me
[push]
default = simple
followTags = true
[credential]
helper = osxkeychain
[url "https://github.com/"]
insteadOf = gh:
[url "https://gist.github.com/"]
insteadOf = gist:
[alias]
co = checkout
cl = clone
cm = commit
a = add
# Add some file to your gitignore
ignore = !sh -c 'echo $1 >> .gitignore' -
# Add and remove all changes, note how this alias is calling another alias
addremove = !git r && git add . --all
# Show all of my configured aliases
aliases = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\ \t => \\2/' | sort
# For when you made that commit a bit too early, amend
amend = !git log -n 1 --pretty=tformat:%s%n%n%b | git commit -F - --amend
# Show all branches
br = branch -av
# Delete a branch
brdel = branch -D
# Delete branches not on remote (!alert!)
# purge = !git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
# Which files are receiving the most "love"
churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}'
# View the log and diff for a commit (previous if no SHA1 provided)
details = log -n1 -p --format=fuller
# Unstage changes from the index
unstage = reset HEAD --
# stash by default ignores unstashed
stash = stash --all
# View a pretty git log with branch tree
g = !git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
# Update all submodules
subup = submodule update --init
[branch]
autosetuprebase = always
[core]
excludesfile = ~/.gitignore
editor = subl -n -w
[http]
postBuffer = 1572864000
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
[color "diff"]
whitespace = red reverse
[diff]
wsErrorHighlight = all
[colors]
ui = true
[init]
templatedir = ~/.git-templates