-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitconfig
66 lines (64 loc) · 2.68 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
[core]
editor = vim
precomposeunicode = true
pager = delta
[alias]
co = checkout
cob = checkout -b
pushd = push -u origin HEAD
recent = for-each-ref --count=10 --sort=-committerdate refs/heads/ --format="%(refname:short)"
ec = config --global -e
wip = commit -am "WIP"
undo = reset HEAD~1 --mixed
amend = commit -a --amend
fixup = commit --amend -C HEAD
fix = commit --fixup # git fix SHA means git rebase --autosquash will combine it with SHA
serve = instaweb --httpd=webrick # webbrick just requires ruby
stop = instaweb --httpd=webrick --stop
# enable others to push to you
hub = daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose --enable=receive-pack
# diff, etc between current state and latest branch/merge point
diffme = !sh -c \"git diff --no-merges `git oldest-ancestor`..\"
statme = !sh -c \"git diff --stat --no-merges `git oldest-ancestor`..\"
logme = !sh -c \"git log --no-merges `git oldest-ancestor`..\"
oldest-ancestor = !bash -c 'diff -u <(git rev-list --first-parent \"${1:-origin/master}\") <(git rev-list --first-parent \"${2:-HEAD}\") | sed -ne \"s/^ //p\" | head -1' -
# `git wa` to check out `main` to `~/tmp/worktrees/<repo name>`, `git wa dev` to check out the `dev` branch instead.
wa = "! dir=${2:-~/tmp/worktrees/\"$(basename \"$(git rev-parse --show-toplevel)\")\"}; git worktree add \"$dir\" \"${1:-main}\" && cd \"$dir\" #"
# `git wr` to clean up a worktree created with `git wa`.
wr = "! git worktree remove ${1:-~/tmp/worktrees/\"$(basename \"$(git rev-parse --show-toplevel)\")\"} #"
[user]
name = Philip Jagielski
[color]
ui = true
[merge]
tool = vimdiff
stat = true # show diffstat at end of merge
[interactive]
diffFilter = delta --color-only
[delta]
features = side-by-side line-numbers decorations
navigate = true
[push]
default = simple # push to matching branch on origin
# TODO TODO TODO TODO: Work config for work repos.
[includeIf "gitdir:~/wrk/**"]
path = ~/.config/git/wrk-config
[advice]
statusHints = false # disable "how to stage/unstage/add" hints
[diff]
wsErrorHighlight = all # diff and show show whitespace errors.
renames = copies # `git diff` will do basic rename and copy detection
algorithm = histogram
colorMoved = default
[branch]
autosetupmerge = true # automatically let the the local branch track the remote branch
[pull]
ff = only # don't pull unless the branch is up to date (aka don't do a merge commit)
[rebase]
autoStash = true
[init]
defaultBranch = main
[rerere]
enabled = true # Remember how I resolved the same merge conflict last time.
[difftool "diffpdf"]
cmd = diff-pdf --view \"$LOCAL\" \"$REMOTE\"