forked from Nthalk/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
50 lines (50 loc) · 2.05 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
[color]
ui = auto
[rerere]
enabled = 1
autoupdate = 1
[push]
default = simple
[pull]
rebase = true
[core]
editor = vim
ignorecase = false
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
pager = delta
[delta]
plus-style = "syntax #012800"
minus-style = "syntax #340001"
syntax-theme = Monokai Extended
features = side-by-side line-numbers decorations
[delta "decorations"]
commit-decoration-style = bold yellow box ul
file-style = bold yellow ul
file-decoration-style = none
hunk-header-decoration-style = cyan box ul
[interactive]
diffFilter = delta --color-only
[alias]
# workflow
default-branch = "!git rev-parse --abbrev-ref origin/HEAD | cut -c8- | xargs -n 1"
co = checkout
master = "!git checkout $(git default-branch)"
branch-name = "!git rev-parse --abbrev-ref HEAD"
publish = "!git push -u origin HEAD"
pull-request = "!git publish && gh pr create $@"
unpublish = "!git push origin :$(git branch-name)"
code-review = difftool origin/master...
rebase-branch = "!git rebase -i `git merge-base $(git default-branch) HEAD`"
delete-merged-branches = "!git co $(git default-branch) && git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d && git remote prune origin"
delete-merged-branches-this = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d && git remote prune origin"
ours = "!f() { git co --ours $@ && git add $@; }; f"
theirs = "!f() { git co --theirs $@ && git add $@; }; f"
cleanup = "!git remote prune origin && git repack && git prune-packed && git gc --aggressive"
# Helpers and tuners
filelog = log -u
grep = grep -Ii
diff = diff --word-diff
ls = log --pretty='%Cred%h%Creset | %C(yellow)%d%Creset %s %Cgreen(%ad)%Creset %C(cyan)[%an]%Creset' --date=human --no-merges
lsm = log --pretty='%Cred%h%Creset | %C(yellow)%d%Creset %s %Cgreen(%ad)%Creset %C(cyan)[%an]%Creset' --date=human
ll = log --pretty=format:"%C(red)%h%C(yellow)%d\\ %Creset%s%Cblue\\ %Cgreen(%ad)%C(cyan)\\ [a:%an,c:%cn]" --decorate --numstat --no-merges --date=human