-
Notifications
You must be signed in to change notification settings - Fork 7
/
gitconfig
141 lines (120 loc) · 3.58 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
[alias]
br = branch
ci = commit
cm = commit -m
cl = clone
co = checkout
cp = cherry-pick
d = diff --word-diff=color
diff = diff --word-diff=color
dc = diff --cached
pom = "!git push origin master"
sl = stash list
sa = stash apply
ss = stash save
st = status -s
unstage = reset HEAD --
# Adds a file to .gitignore.
ignore="!f() { echo $1 >> \"${GIT_PREFIX}.gitignore\"; }; f"
# Ignores a file that's in the repository.
lock="update-index --skip-worktree"
# Stop ignoring a file that's in the repository.
unlock="update-index --no-skip-worktree"
# Show modified files in last commit.
dl = "!git ll -1"
# Show a diff of the last commit
dlc = diff --cached HEAD^
# Show a diff of specific commit
dr = "!f() { git diff "$1"^.."$1"; }; f"
# List files modified in the given commit. Defaults to current commit.
wo = "!f() { git diff-tree --no-commit-id --name-only -r "${1:-HEAD}"; }; f"
# Find a file in the codebase
f = "!git ls-files | grep -i"
#list remotes
rem="!git config -l | grep remote.*url | tail -n +2"
# Search codebase for a string
grep = grep -Ii
gr = grep -Ii
le = log --oneline --decorate
ll = log --pretty=format:"%C(yellow)%h%C(red)%d\\ %C(reset)%s%C(blue)\\ [%cn]" --decorate --stat
llp = log --pretty=format:"%C(yellow)%h%C(red)%d\\ %C(reset)%s%C(blue)\\ [%cn]" --decorate --stat -p --word-diff=color --function-context
# hash [authorDate] (branch) summary [committerName]
ls = log --pretty=format:"%C(yellow)%h\\ %C(green)[%ad]%C(red)%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
# Same as ls with no date
ls1 = log --pretty=format:"%C(yellow)%h%C(red)%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
lds = log --pretty=format:"%C(yellow)%h\\ %C(green)%ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short --graph
lg = log --graph --pretty=format:"%C(yellow)%h\\ %C(green)%ad%C(red)%d\\ %C(reset)%s%C(blue)\\ [%cn]" --abbrev-commit --date=relative
lc = "!f() { git ll $1^..$1; }; f"
# Plain, no color - hash commitMessage [committerName]
lnc = log --pretty=format:"%h\\ %s\\ [%cn]"
changes = diff --name-status -r
diffstat = diff --stat -r
# new = !sh -c 'git log $1@{1}..$1@{0} "$@"'
new = !git log $1@{1}..$1@{0} "$@"
prune-all = !git remote | xargs -n 1 git remote prune
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'
# list who has contributed to a project
who=shortlog -n -s --no-merges
# remove local and remote branches
rmb = !sh -c 'git branch -D $1 && git push origin :$1' -
up = pull --rebase upstream master
[color]
branch = auto
diff = auto
interactive = auto
status = auto
ui = auto
[core]
editor = emacsclient
excludesfile = ~/.config/git/global_gitignore
pager = less -+$LESS -FRX
eol = lf
autocrlf = input
commitGraph = true
[diff]
renames = copies
algorithm = histogram
[user]
name = Joe Schafer
email = [email protected]
[push]
default = simple
[merge]
stat = true
[include]
path = ~/.config/github/gitconfig
path = ~/.gitconfig-system
[url "[email protected]:jschaf/"]
insteadOf = "ghj:"
[url "https://github.com/"]
insteadOf = "gh:"
[url "ssh://[email protected]/"]
insteadOf = https://github.com/
[filter "media"]
clean = git-media-clean %f
smudge = git-media-smudge %f
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[credential]
helper = netrc
[help]
# Autocorrect spelling mistakes, e.g. git checkout -> git checkout.
autocorrect = 1
[pull]
rebase = true
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[magit]
hideCampaign = true
[gc]
writeCommitGraph = true
[pack]
sparse = true
[init]
defaultBranch = main