-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
103 lines (75 loc) · 2.5 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
103
[branch]
autosetuprebase = always
[push]
default = tracking
[rerere]
enabled = 1
autoupdate = true
[color]
ui = auto
status = auto
branch = auto
interactive = auto
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
[core]
whitespace = fix,-indent-with-non-tab,-indent-with-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore_global
; Fancy aliases
[alias]
; Diff, including staged changes.
df = !git diff --no-prefix && git diff --staged --no-prefix
clear = reset --hard
s = status -sb
co = checkout
b = branch
; List branches in latest commit date order.
bdate = for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:short)%09%(refname:short)'
; Delete merged local branches.
bdm = !git branch --merged | grep -v master | xargs git branch -d
ci = commit
cim = commit -m
last = log -l HEAD
unadd = reset HEAD --
sm = submodule
f = fetch
cp = cherry-pick
; Pretty log.
lp = log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
a = add .
; Init shorthand.
this = !git init && git add . && git commit -m \"initial commit\"
; List git aliases.
alias = !git config --list | grep -E 'alias\\.' | sed -E 's/alias\\.([^=]*)=(.*)/\\1 => \\2/' | sort
hist = log --graph --all --full-history --color --branches --decorate --oneline
; Find todos in repo code.
todo = grep --heading --break --ignore-case -e ' FIX: *' -e ' TODO: *'
; List untracked files.
untracked = ls-files --other --exclude-standard
; Mark unstaged files as untracked, temporarily.
; Works only with files, not directories.
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
; Take a snapshot of your current working tree without removing
; the changes from your tree.
snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"
; Easy merging, pick a file(s) from the current branch or
; the merged branch respectively:
ours = "!f() { git checkout --ours $@ && git add $@; }; f"
theirs = "!f() { git checkout --theirs $@ && git add $@; }; f"
btrack = for-each-ref --format='%(refname:short) <- %(upstream:short)' refs/heads
[credential]
helper = osxkeychain
[diff]
algorithm = patience
[merge]
tool = diffmerge
[mergetool "diffmerge"]
trustExitCode = true
[include]
path = ~/.gitconfig_private