-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgitconfig.erb
105 lines (98 loc) · 3.25 KB
/
gitconfig.erb
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
[user]
name = <%= print("Your Name: "); STDOUT.flush; STDIN.gets.chomp %>
email = <%= print("Your Email: "); STDOUT.flush; STDIN.gets.chomp %>
initials = <%= print("Your Initials: "); STDOUT.flush; STDIN.gets.chomp %>
[alias]
co = checkout
ci = commit
st = status
ch = cherry -v origin
br = branch
wdiff = diff --color-words
# show difference between the HEAD and the index
staged = diff --cached
# show difference between working tree and the index
unstaged = diff
# show staged and unstaged changes (what would be committed with "git commit -a")
both = diff HEAD
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%an, %cr)%Creset' --abbrev-commit --date=human
lga = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%an, %cr)%Creset' --abbrev-commit --date=human --all
# git showf <ref>
#
# Fetch the full SHA1 for the given ref and copy it to the clipboard. Then,
# call `git show --format=fuller <ref>`.
#
# If no ref is specified, use HEAD as the ref.
showf = "!f() { ref="$@"; if [ $# -eq 0 ]; then ref="HEAD"; fi; git rev-parse $ref | pbcopy; git show --format=fuller $ref; }; f"
# Rename [branch] to z-[branch]
#
# Useful for renaming old branches (that you're not yet ready to delete) in a
# way that puts them at the bottom of the list when you run `git branch`
#
# Credit: http://durdn.com/blog/2012/11/22/must-have-git-aliases-advanced-examples/#rename_branch_to_donebranch
z = "!f() { git branch | grep "$1" | cut -c 3- | grep -v z- | xargs -I{} git branch -m {} z-{}; }; f"
[color]
diff = auto
status = auto
branch = auto
[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
[merge]
tool = opendiff
conflictstyle = zdiff3
[core]
excludesfile = <%= ENV['HOME'] %>/.gitignore
autocrlf = input
legacyheaders = false
editor = $EDITOR --wait
pager = less -ce3MR
[repack]
usedeltabaseoffset = true
[apply]
whitespace = nowarn
[format]
pretty = %C(yellow)%h%Creset %s %C(red)(%an, %cr)%Creset%n%n%-b
[github]
user = <%= print("GitHub Username: "); STDOUT.flush; STDIN.gets.chomp %>
token = <%= print("GitHub API Token: "); STDOUT.flush; STDIN.gets.chomp %>
[push]
default = tracking
[diff]
compactionHeuristic = true
[diff "ruby"]
funcname = ^ *\\(\\(class\\|module\\|def\\) .*\\)
[interactive]
diffFilter = $(brew --prefix git)/share/git-core/contrib/diff-highlight/diff-highlight
[pager]
log = $(brew --prefix git)/share/git-core/contrib/diff-highlight/diff-highlight | less
show = $(brew --prefix git)/share/git-core/contrib/diff-highlight/diff-highlight | less
diff = $(brew --prefix git)/share/git-core/contrib/diff-highlight/diff-highlight | less
[url "git@github.com:"]
insteadOf = "gh:"
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
[url "git://github.com/"]
insteadOf = "github:"
[url "git@gist.github.com:"]
insteadOf = "gst:"
pushInsteadOf = "gist:"
pushInsteadOf = "git://gist.github.com/"
[url "git://gist.github.com/"]
insteadOf = "gist:"
[commit]
gpgsign = true
[protocol]
version = 2
[init]
defaultBranch = main