-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitconfig
97 lines (88 loc) · 3.01 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
[includeIf "gitdir:~/"]
path = ~/.gitconfig.personal
[push]
default = simple
[core]
editor = vim
autocrlf = false
excludesfile = /Users/jahson/.gitignore_global
# Make `git rebase` safer on OS X
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
trustctime = false
[diff]
tool = vimdiff
[merge]
tool = vimdiff
[color]
ui = auto
status = auto
branch = auto
interactive = auto
diff = auto
[alias]
### GitLab
mr = !sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -
### Explore your history, the commits and the code
# List commits in short form, with colors and branch/tag annotations
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
# List commits showing changed files is invoked with git ll and looks like this:
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
# List with no colors if you need to chain the out put with Unix pipes:
lnc = log --pretty=format:"%h\\ %s\\ [%cn]"
# List oneline commits showing dates:
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
# List oneline commits showing relative dates:
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
# Short git log
le = log --oneline --decorate
# Graph
lg = log --graph --pretty="format:%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]"
### Show the history of a file, with diffs
# List all the commits related to a file, with the diff of the changes
filelog = log -u
fl = log -u
### Basic Shortcuts
diff = diff --word-diff
dc = diff --cached
# contributors ordered by number of commits
rank = shortlog -sn --no-merges
last = cat-file commit HEAD
mn = merge --no-ff
type = cat-file -t
dump = cat-file -p
# Show status and diff on dirty submodules
subdiff = !"git submodule foreach --recursive --quiet '[ \"$(git status -s)\" ] && echo \"$name\" && git status -s && git diff --unified=1 || :'"
# Pull all submodules
subpull = !"git submodule foreach git pull"
# Update all submodules
subupdate = !"git submodule sync && git submodule update --init --recursive"
# Checkout master branch of all submodules
subcheckout = !"git submodule foreach git checkout master"
# Reset all submodules
subreset = !"git submodule foreach --recursive git checkout -- . && git submodule foreach --recursive git clean -f"
# Add modified files to previous commit
oops = !"git add -A -v && git commit --amend -C HEAD"
git = !exec git
[credential]
helper = osxkeychain
[filter "media"]
clean = git-media-clean %f
smudge = git-media-smudge %f
[filter "hawser"]
clean = git hawser clean %f
smudge = git hawser smudge %f
required = true
[gui]
fontdiff = -family \"Input Mono Narrow\" -size 12 -weight normal -slant roman -underline 0 -overstrike 0
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
[stash]
showPatch = true
[rebase]
autostash = true
[pull]
ff = only
[commit]
gpgsign = true