-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.gitconfig
73 lines (73 loc) · 3.24 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
[user]
name = Matt Robinson
email = [email protected]
[includeIf "gitdir:~/ghwork/"]
path = .gitconfig-github
[includeIf "gitdir:/workspaces/"]
path = .gitconfig-github # at least for now not doing personal projects in codespaces...
[core]
excludesfile = ~/.gitignore
whitespace = trailing-space,space-before-tab
pager = less -FXRS -x2
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = auto
[alias]
br = for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
amend = "commit --amend"
main = !git symbolic-ref refs/remotes/origin/HEAD | cut -d'/' -f4
remotesh = remote set-head origin --auto
rom = !"git fetch; git rebase origin/$(git main)"
tagdate = "tag -l --sort=-creatordate --format='%(creatordate:short): %(refname:short)'"
ff = pull --ff-only --ff
st = status
ci = commit
co = checkout
com = !"git checkout $(git main)"
llog = log --date=local
lg = "log --date=format:'%Y%m%d %H:%M' --pretty=format:'%C(yellow)%h%C(reset) %s %C(cyan)%cd %cr%C(reset) %C(blue)%an%C(reset) %C(green)%d%C(reset)' --graph --date-order"
llg = !"git log --date=format:'%Y%m%d %H:%M' --pretty=format:'%C(yellow)%h%C(reset) %s %C(cyan)%cd %cr%C(reset) %C(blue)%an%C(reset) %C(green)%d%C(reset)' --no-merges --first-parent origin/$(git main)..."
review = "log --stat=160,180 -p -w --patience --reverse -M -C -C -c"
fixup = !sh -c 'git commit -m \"fixup! $(git log -1 --format='\\''%s'\\'' $@)\"' -
squash = !sh -c 'git commit -m \"squash! $(git log -1 --format='\\''%s'\\'' $@)\"' -
ri = rebase --interactive --autosquash
unstage = reset HEAD
poh = push origin HEAD
copr = "!f() { git fetch -fu origin refs/pull/$1/head:pr-$1; git checkout pr-$1; } ; f"
# https://ses4j.github.io/2020/04/01/git-alias-recent-branches/
recent = !git reflog show --pretty=format:'%gs ~ %gd' --date=relative | grep 'checkout:' | grep -oE '[^ ]+ ~ .*' | awk -F~ '!seen[$1]++' | head -n 10 | awk -F' ~ HEAD@{' '{printf(\" \\033[33m%s: \\033[37m %s\\033[0m\\n\", substr($2, 1, length($2)-1), $1)}'
recent-all = "!git for-each-ref --sort=committerdate refs/heads/ refs/remotes --format='%(committerdate:short) %(refname:short) %(authorname) %(contents:subject)'"
find-merge = "!sh -c 'commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'"
show-merge = "!sh -c 'merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge'"
# find the pr of a commit
[diff]
renames = copy # makes the diff much shorter when moving or copying files
noprefix = true
compaction-heuristic = true
[status]
submodulesummary = true
[rerere]
enabled = false
[merge]
log = true
conflictstyle = diff3
[apply]
whitespace = nowarn
[branch]
autosetupmerge = true
[rebase]
autosquash = true
[push]
default = simple
[init]
defaultBranch = main
[filter "lfs"]
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
[commit]
#gpgSign = true