forked from ahjota/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_gitconfig.tmpl
More file actions
88 lines (82 loc) · 3.36 KB
/
dot_gitconfig.tmpl
File metadata and controls
88 lines (82 loc) · 3.36 KB
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
[user]
name = AJ Alon
email = {{ .email }}
signingkey = D1D5F0D0EAED84B2
[core]
editor = code --wait
[init]
defaultBranch = main
[pull]
rebase = true
[push]
default = current
gpgSign = if-asked
autoSetupRemote = true
[stash]
showPatch = true
[rebase]
missingCommitsCheck = error
autoSquash = true
[branch]
autosetuprebase = always
[credential]
{{ if eq .chezmoi.os "darwin" }}
helper = osxkeychain
{{ end }}
[checkout]
defaultRemote = origin
[alias]
st = status
co = checkout
ci = commit
cp = cherry-pick
br = branch
nb = switch -
adp = add -p
cop = checkout -p -- .
rhp = reset HEAD -p
rsp = restore --staged -p
sp = stash -p
l = log -1 HEAD
l2 = log -2 HEAD
l3 = log -3 HEAD
# https://davidwalsh.name/get-default-branch-name
default-branch = !git remote show origin | grep 'HEAD branch' | cut -d' ' -f5
rebaseia = rebase -i --autosquash
rebaseiam = !git rebase -i --autosquash $(git default-branch)
please = push --force-with-lease
praise = blame
# https://haacked.com/archive/2014/07/28/github-flow-aliases/
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
co = checkout
cob = checkout -b
cm = !git add -A && git commit -m
save = !git add -A && git commit -m 'SAVEPOINT'
wip = commit -am "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 checkout ${1-master} && git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs git branch -d; }; f"
bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f"
migrate = "!f(){ CURRENT=$(git symbolic-ref --short HEAD); git checkout -b $1 && git branch --force $CURRENT ${3-$CURRENT@{u}} && git rebase --onto ${2-master} $CURRENT; }; f"
# https://coderwall.com/p/euwpig/a-better-git-log
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
# https://hackernoon.com/lesser-known-git-commands-151a1918a60
please = push --force-with-lease
commend = commit --amend --no-edit
st = status -sb -uall
grog = log --graph --abbrev-commit --decorate --all --format=format:\"%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(dim white) - %an%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n %C(white)%s%C(reset)\"
# @jeffesp
# bonk = "push head" e.g. push branch with the same name to remote
bonk = push --set-upstream origin HEAD
# @jmbledsoe
# trim = delete all branches that are fully merged into their upstream branches
# squash = similar to 'git merge --squash', but without committing
trimdryrun = "!f() { git branch | grep -v '^\\*' | xargs cat; }; f"
trim = "!f() { git branch | grep -v '^\\*' | xargs git branch -D; }; f"
squash = "!f() { git reset $(git merge-base ${1-master} $(git rev-parse --abbrev-ref HEAD)); }; f"
branchdate = for-each-ref --count=10 --sort=-committerdate refs/heads/ --format="%(authordate:short)%09%(objectname:short)%09%1B[0;33m%(refname:short)%1B[m%09"
[commit]
gpgsign = true
[tag]
gpgSign = true