This repository has been archived by the owner on Dec 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitconfig
102 lines (82 loc) · 2.17 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
99
100
101
102
[user]
name = srigi
email = [email protected]
[core]
autocrlf = input
editor = vim
ignorecase = false
pager = `brew --prefix git`/share/git-core/contrib/diff-highlight/diff-highlight | less
whitespace = nowarn
[http]
cookiefile = /Users/srigi/.gitcookies
[mergetool]
keepBackup = true
[credential]
helper = osxkeychain
[alias]
br = branch -vv
conflicts = diff --name-only --diff-filter=U
s = status -sb
st = status
optimise = !git prune && git gc --aggressive && git repack -a && git prune-packed
# checkout
co = checkout
# commit
c = commit -m
ca = commit -am
ci = commit
amend = commit --amend
# diff
d = diff
dc = diff --cached
last = diff HEAD^
# log
l = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --abbrev=9
lme = !"git l --author='srigi'"
ll = !"git l --name-status"
lll = !"git l --stat"
mystats = log --author='srigi' --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }'
changelog = log --pretty=format:' * %s'
# rebase
rib = rebase -i --autostash
rbi = rebase -i --autostash
rba = rebase --abort
rbc = rebase --continue
rbs = rebase --skip
# remote
r = remote -v
# create a new named branch
# commit any changes on that branch
# swap you back to the branch you started on
# usage: git save foobar
save = !sh -c 'export PREV=$(git symbolic-ref HEAD|cut -d/ -f3-) && git checkout -b "$1" && git commit -am "$1" && git checkout "$PREV"' -
#tags
tags = show-ref --tags
[color]
ui = true
[color "status"]
branch = yellow reverse
added = yellow
changed = green
untracked = cyan
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow
frag = cyan
new = blue
old = red
whitespace = white reverse
[diff]
# Git diff will use (i)ndex, (w)ork tree, (c)ommit and (o)bject
# instead of a/b/c/d as prefixes for patches
mnemonicprefix = true
compactionHeuristic = on
indentHeuristic = on
[push]
# don't push all local branches, only ones that are already on remote
default = tracking
[rerere]
enabled = true