-
Notifications
You must be signed in to change notification settings - Fork 7
/
.gitconfig
97 lines (85 loc) · 2.69 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
[user]
name = Tim Marcus Moore
email = [email protected]
[commit]
verbose = true
[credential]
helper = osxkeychain
[diff]
indentHeuristic = true
mnemonicPrefix = true
renames = copy
algorithm = histogram
colorMoved = default
[fetch]
prune = true
[help]
autoCorrect = 10
[init]
defaultBranch = main
[log]
follow = true
[merge]
conflictStyle = diff3
[pager]
log = /usr/local/share/git-core/contrib/diff-highlight/diff-highlight | less
show = /usr/local/share/git-core/contrib/diff-highlight/diff-highlight | less
diff = /usr/local/share/git-core/contrib/diff-highlight/diff-highlight | less
branch = false
[pull]
rebase = true
[push]
# "simple" is the default in Git 2.0+, but make it explicit
# in case I ever end up using an older version of git.
default = simple
[rebase]
autoSquash = true
autoStash = true
[stash]
showPatch = true
[alias]
# Shortcuts
b = branch
br = branch
co = checkout
cp = cherry-pick
stat = status
s = switch
sw = switch
up = push -u TimMoore HEAD
# ff = fast-forward:
# Pulls upstream changes and updates the local branch to match.
# Fails if there are local changes that aren't on the remote,
# in which case you should rebase.
ff = pull --ff-only
# fff = fast-fast-forward:
# Just like "ff" but doesn't fetch from the remote. Use this if you've
# recently fetched and just need to update your local branch
fff = merge --ff-only
# Prints a list of conflicting files.
# You can use `git conflicts|xargs $EDITOR` to open them all
# in your favorite editor.
conflicts = diff --name-only --diff-filter=U
serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git
squash = !git rebase --interactive $(git merge-base master HEAD)
# Credit to http://codersopinion.com/blog/16-awesome-git-aliases-that-you-will-love/
authors = shortlog -sne --no-merges
graph = log --graph --oneline --decorate
overview = graph --all --simplify-by-decoration
st = status -sb
# Credit to https://hackernoon.com/lesser-known-git-commands-151a1918a60
amend = commit --amend
please = push --force-with-lease
# Credit to https://github.com/tj/git-extras
merged = branch --merged
delete-merged = !git branch --no-color --merged | grep -v -E -e '^(\\*|\\+)' -e "$(git config --get init.defaultBranch)" | xargs -n 1 git branch -d
since = !git --no-pager log --all --no-merges --author='Tim Moore' --oneline --since
week = since 'last week'
# Credit to https://stackoverflow.com/a/7149602/29470
add-w = !git diff -U0 --ignore-space-at-eol --no-color "$@" | git apply --cached --ignore-whitespace --unidiff-zero -
# Used by the hub tool
[github]
user = TimMoore
# Allow local overrides (useful for work email addresses)
[include]
path = ~/.gitconfig.local