forked from addyosmani/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitconfig
118 lines (103 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
[user]
name = George Crawford
email = [email protected]
[core]
editor = "code -n -w"
# pager = cat
excludesfile = /Users/george/.gitignore_global
attributesfile = ~/.gitattributes
whitespace = fix,space-before-tab,blank-at-eol,tabwidth=4
trustctime = false
[alias]
a = add
br = branch
ci = commit
c = commit -m
ca = commit -am
co = checkout
cp = cherry-pick
# Show the diff between the latest commit and the current state
d = !"git diff-index --quiet HEAD -- || clear; git diff --dst-prefix= --patch-with-stat --ignore-space-change -w"
dw = !"git diff-index --quiet HEAD -- || clear; git diff --color-words --patch-with-stat --ignore-space-change -w"
ds = !"clear; git diff --staged --patch-with-stat --ignore-space-change -w"
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
dt = difftool
df = diff --color --color-words --abbrev
hist = log --pretty=tformat:'%x09%C(blue)%h %C(red)%ad%C(reset)%C(red) (%ar) %C(yellow)%an%C(reset): %s%C(green)%d%n' --date=short --graph --date-order --max-count=100
# View abbreviated SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph --abbrev-commit
p = push
pr = !"sh -c 'stash pull-request $0'"
# View the current working tree status using the short format
s = status -sb
up = pull
# Show verbose output about tags, branches or remotes
tags = tag -l
branches = branch -a
remotes = remote -v
# Find branches containing commit
fb = "!f() { git branch -a --contains $1; }; f"
# Find tags containing commit
ft = "!f() { git describe --always --contains $1; }; f"
# Find commits by source code
fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f"
# Find commits by commit message
fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
# Open conflicted files in Code
fix = !"git diff --name-only | uniq | xargs code"
[push]
default = tracking
[color]
ui = auto
diff = always
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[mergetool]
keepBackup = false
[diff]
renames = copy
mnemonicprefix = true
tool = code-difftool
[merge]
tool = code-difftool
stat = true
[mergetool]
keepBackup = false
prompt = false
[init]
templatedir = ~/Projects/dotfiles/Git/templates/
[apply]
whitespace = fix
[mergetool "sourcetree"]
cmd = /Applications/DiffMerge.app/Contents/MacOS/DiffMerge --merge --result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"
trustExitCode = true
[help]
autocorrect = 1
[credential]
helper = osxkeychain
[rerere]
enabled = true
autoupdate = true
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[url "https://"]
insteadOf = git://
[fetch]
prune = true
[difftool "code-difftool"]
cmd = code --wait --diff $LOCAL $REMOTE
[pager]
branch = false