-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitconfig
27 lines (27 loc) · 1.34 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
[user]
name = Paul Cochrane
email = [email protected]
[core]
excludesfile = ~/.gitignore_global
[alias]
st = status
di = diff
ci = commit -v
hist = log --graph --all --color=always --decorate --oneline
co = checkout
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)\"
stashed = stash list --pretty=format:'%gd: %Cred%h%Creset %Cgreen[%ar]%Creset %s'
cherrypick = cherry-pick
nuke = !"f() { git branch -d $1 && git push origin --delete $1; }; f"
test-fork = !"f() { \
[ x$# = x1 ] && testcmd=\"$1\" || testcmd='make test'; \
upstream_base_branch=$(git branch --remotes | grep 'origin/\\(HEAD\\|master\\|main\\)' | cut -d'>' -f2 | head -n 1); \
current_branch=$(git rev-parse --abbrev-ref HEAD); \
fork_point=$(git merge-base --fork-point $upstream_base_branch $current_branch); \
git rebase $fork_point -x \"git log -1 --oneline; $testcmd\"; \
}; f"
trim = !"f() { git remote prune origin | grep prune | cut -d '/' -f2 | xargs --no-run-if-empty git branch -D; }; f"
[color]
ui = true
[push]
default = current