-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
36 lines (36 loc) · 1.55 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
[user]
name = Tim Roes
email = [email protected]
[alias]
b = checkout -b
m = checkout master
master = checkout master
main = checkout main
lastdiff = diff HEAD^ HEAD
pn = "!git push -u origin \"$(git rev-parse --abbrev-ref HEAD)\""
upstream = "!git remote update upstream && git reset --hard upstream/\"$(git rev-parse --abbrev-ref HEAD)\""
tree = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'
treef = log --all --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'
pr = "!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
cleanup-prs = "!git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done"
cleanup-local = "!git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -D"
pp = "! \
push() { \
[[ $# -ne 2 ]] && echo 'Illegal parameter' && exit 1; \
cmd=\"git push $(git remote get-url upstream | sed -E \"s|^([^:]+:)[^\\/]+(\\/.*)|\\1$1\\2 HEAD:$2|\")\"; \
echo \"Executing: $cmd\"; \
eval $cmd; \
}; \
params=$(echo \"$1\" | sed -E 's/([^:]):(.*)/\\1 \\2/'); \
shift; \
push $params"
[pull]
rebase = false
[fetch]
prune = true
[core]
editor = vim
[init]
defaultBranch = main
[status]
relativePaths = false