forked from anishathalye/dotfiles_template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitconfig
executable file
·112 lines (107 loc) · 4.2 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
[core]
editor = nvim
pager = delta
#pager = diff-so-fancy | less --tabs=4 -RFX
#autocrlf = true
[interactive]
diffFilter = delta --color-only --features=interactive
# diffFilter = diff-so-fancy --patch
[user]
name = lbesnard
email = laurent.besnard@utas.edu.au
[credential]
helper = cache --timeout=36000
[status]
showUntrackedFiles = no
[log]
page = delta
#[diff]
# pager = diff-so-fancy | less --tabs=4 -RFX
[merge]
conflictstyle = diff3
[delta]
navigate = true # use n and N to move between diff sections
light = false # set to true if you're in a terminal w/ a light background color (e.g. the default macOS terminal)
features = decorations
minus-style = syntax bold auto
[delta "interactive"]
keep-plus-minus-markers = false
[delta "decorations"]
commit-decoration-style = blue ol
commit-style = raw
file-style = omit
hunk-header-decoration-style = blue box
hunk-header-file-style = red
hunk-header-line-number-style = "#067a00"
hunk-header-style = file line-number syntax
[color]
ui = true
branch = auto
diff = auto
interactive = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = 11
frag = magenta bold
old = red bold
new = green bold
func = 146 bold
commit = yellow bold
whitespace = red reverse
[color "status"]
added = yellow
changed = green
untracked = cyan
#
# http://haacked.com/archive/2014/07/28/github-flow-aliases/
[alias]
alias = !tac ~/.gitconfig | sed -e '/alias/q' |tac | tail -n+2
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
ss = stash save
sp = stash pop
#s = status -uno
s = status -u
a = add
p = pull
b = branch
d = diff
l = log
co-wip = !git commit -m 'wip'
hash = !git log -1 --format=format:'%H'
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
co = checkout
com = "!f() { if git show-ref --verify --quiet refs/heads/main; then git checkout main; elif git show-ref --verify --quiet refs/heads/master; then git checkout master; else echo 'No main or master branch found'; return 1; fi && git pull && git branch --merged | grep -v 'main' | grep -v 'master' | xargs -r git branch -d && git fetch --all; }; f"
co-pr = !sh -c 'git fetch origin pull/$1/head:pr/$1 && git checkout pr/$1' -
co-wip-and-squash-last = !git co-wip && git squash-auto
squash-auto = !"f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f"
push-force-branch = !"f() { git branch | grep '*' | sed 's/* //g' | xargs git push -f origin; }; f"
push-branch = !"f() { git branch | grep '*' | sed 's/* //g' | xargs git push origin; }; f"
co-wip-and-push-branch = !git co-wip && git push-branch
squash-last = !"f() { NL=$1; GIT_EDITOR=\"sed -i '2,$NL s/pick/squash/;/# This is the 2nd commit message:/,$ {d}'\"; git rebase -i HEAD~$NL; }; f"
ec = config --global -e
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
cob = checkout -b
cm = !git add -A && git commit -m
save = !git add -A && git commit -m 'SAVEPOINT'
wip = !git add -u && git commit -m "WIP"
undo = reset HEAD~1 --mixed
amend = commit -a --amend
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs -r git branch -d; }; f"
bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f"
reset-branch-like-remote = "!f() { branch=`git branch | grep '*' | sed 's/* //g'`; git fetch --all; git reset --hard origin/$branch; }; f"
sync-and-stash = "!f() { \\\n branch=$(git symbolic-ref --short HEAD); \\\n gh repo sync --branch \"$branch\" && \\\n git stash --all && \\\n git stash pop; \\\n}; f"
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[diff-so-fancy]
markEmptyLines = false
changeHunkIndicators = false
stripLeadingSymbols = false