-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitconfig
114 lines (93 loc) · 3.32 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
113
114
[user]
name = Harmen Janssen
email = [email protected]
signingkey = F603DC009126FE64
[core]
autocrlf = input
safecrlf = warn
editor = nvim
fileMode = false
excludesfile = ~/.gitignore
ignorecase = false
pager = delta
[push]
default = upstream
[alias]
# Typos
cloen = clone
# Shortcuts
co = checkout
ci = commit
st = status
br = branch
amend = commit --amend -C HEAD
fixup = commit --fixup
squash = commit --squash
rh = reset --hard
# Pretty logs and diffs
l = log --graph --pretty=format':%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ai%Creset'
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
ls = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%an]" --decorate --date=short
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%an]" --decorate --numstat
lastchange = log -p --follow -n 1
changelog = diff-tree --no-commit-id --name-only
dl = "!git ll -1"
dlc = diff --cached HEAD^
dif = "!git diff --color | sed -E \"s/^([^-+ ]*)[-+ ]/\\1/\" | less -r"
my-changes = ls main..
their-changes = ls ..main
# Branches, publishing, tracking, rebasing
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Get the main branch (main or master)
main = "! git rev-parse -q --verify --symbolic main || git rev-parse -q --verify --symbolic master;"
track = "!f() { git branch --track $1 origin/$1 && git co $1; }; f"
publish = "!git push -u origin $(git branch-name)"
unpublish = "!git push origin :$(git branch-name)"
unstage = reset HEAD
rbi = !sh -c \"git rebase -i `git merge-base $1 HEAD`\" -
ff = "!f() { git merge --ff-only $1 && git branch -d $1; }; f"
rename = "branch -m"
delete = "!f() { if [ $(git log --left-right --oneline --cherry-pick $1... | sed -n -e '/^</p' | wc -l) -gt 0 ]; then git branch -d $1; else git branch -D $1; fi }; f"
continue = rebase --continue
abort = rebase --abort
# Misc
alias = "!git config -l | grep alias | cut -c 7-"
tags = tag --sort=v:refname
tt = "!git tags | tail"
ctags = !.git/hooks/ctags
type = cat-file -t
dump = cat-file -p
pop = stash pop
checkpoint = !git stash; git stash apply
feature = "!f() { git checkout -b 'feature/'$(git config user.name | cut -d' ' -f1 | awk '{print tolower($0)}')'-'$1; }; f"
hotfix = "!f() { [ x$# != x2 ]&&echo "Two arguments required!" >&2 || git checkout -b 'hotfix/'$(git config user.name | cut -d' ' -f1 | awk '{print tolower($0)}')'-'$1 $2; }; f"
branches = for-each-ref --sort=-committerdate --format=\"%(align:1,20)%(color:blue)%(authordate:relative)%(end)%(align:1,30)%(color:red)%(authorname)%(end)%(color:white)%(color:bold)%(refname:short)\" refs/remotes
[color]
ui = auto
[mergetool]
keepBackup = true
[merge "composer_json"]
name = composer JSON file merge driver
driver = composer-git-merge-driver %O %A %B %L %P
recursive = binary
[merge]
;conflictstyle = diff3
[rerere]
enabled = 1
[init]
templatedir = ~/.git_template
defaultBranch = main
[interactive]
;diffFilter = diff-highlight
[commit]
;gpgsign = true
;verbose = true
[gpg]
program = gpg
[rebase]
autosquash = true
autoStash = true
[remote "origin"]
prune = true
[pull]
rebase = true