-
Notifications
You must be signed in to change notification settings - Fork 0
/
private_dot_gitconfig.tmpl
69 lines (63 loc) · 2.52 KB
/
private_dot_gitconfig.tmpl
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
# This is Git's per-user configuration file.
[user]
name = Kate Donaldson
email = {{ .email | quote }}
[github]
user = {{ .githubusername | quote }}
[alias]
la = log --graph --color --pretty=\"format:%C(yellow)%h%Creset%C(green)%d%Creset %s %Cblue[%aN]%Creset %C(magenta){%cr}%Creset\" --all
ac = !git add -A && git commit
latest = "!bash -c 'git for-each-ref --format=\"%(*committerdate:raw)%(committerdate:raw) %(refname) %(*objectname) %(objectname)\" refs/tags | sort -n | awk \"{ print \\$4, \\$3 }\" | tail -n 1'"
co-pr = !sh -c 'git fetch origin pull/$1/head:pr/$1 && git checkout pr/$1' -
deploy = "!f() { \
if [[ ! -z $1 && ! -z $2 ]]; then \
git checkout $1; \
git push; \
git checkout $2; \
git merge $1; \
git push; \
git checkout $1; \
else \
echo '\n\nUsage: git deploy [development branch] [main branch]\n\n'; \
fi; \
}; f"
cln = "!f() { \
if [ ! -z $1 ]; then \
git remote prune origin && \
if git show-ref refs/heads/$1; then \
echo 'checking out' $1 && git checkout $1; \
git fetch --all && \
git pull && \
git branch --merged | grep -vE 'dev$| main$| master$| staging$| testing$ |develop$' | xargs -n 1 git branch -d; \
git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D; \
else \
echo '\n\nBranch does not exist:' $1 '\n\n'; \
fi; \
else \
echo '\n\nUsage: git cln <branch>\n\n'; \
fi; \
}; f"
tidy = "!f() { \
if [[ ! -z $1 && $1 != '--dry-run' && $1 != '-d' ]]; then \
if [[ $2 == '--dry-run' || $2 == '-d' ]]; then \
git checkout $1 && git remote prune origin && git branch --merged | grep -vE '^[ \\*]*(dev|main|master|staging|testing|develop)$' | awk '{print $1}'; \
else \
git checkout $1 && git remote prune origin && git branch --merged | grep -vE '^[ \\*]*(dev|main|master|staging|testing|develop)$' | awk '{print $1}' | xargs git branch -D; \
fi \
else \
echo '\n\nUsage: git tidy <branch> [--dry-run|-d]\n\n'; \
fi; \
}; f"
rbi = !sh -c \"git rebase -i `git merge-base $1 HEAD`\" -
pub = "!git push -u origin $(git rev-parse --abbrev-ref HEAD)"
s = !git status
co = checkout
ignore = "!gi() { curl -sL https://www.gitignore.io/api/$@ ;}; gi"
[core]
editor = vim
excludesfile = ~/.gitignore_global
[init]
templatedir = ~/.git-templates
defaultBranch = main
[pull]
rebase = false