-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
83 lines (82 loc) · 2.24 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
[alias]
a = add
aa = add -A .
b = branch
bd = branch -D
c = checkout
cb = checkout -b
cf = !git c devel && git pl && git cb
cl = clone
cm = commit -am
cma = commit -a --amend
d = diff
ds = diff --staged
f = fetch
g = log --all --oneline --graph
hf = !git c hotfix && git c master && git pl && git m --no-edit hotfix && git ps && git c devel && git pl && git m --no-edit hotfix && git ps && git bd hotfix
hfc = !git c master && git pl && git cb hotfix
m = merge --no-ff
ma = merge --abort
mc = merge --continue
md = !git c test && git pl && git m devel --no-edit && git ps
mf = !git c devel && git pl && git m - --no-edit && git ps
mfd = !git mf && git md
mfdt = !git mf && git md && git mt
mt = !git c master && git pl && git m test --no-edit && git ps
pf = push -f
pl = pull -r
po = push origin
pr = "!alias_git_pr() {\
usage () { echo \"usage: git pr [-b <target>] [-t <title>] [<reviewers>...]\"; };\
local dst=\"devel\";\
local src=$(git rev-parse --abbrev-ref HEAD);\
local title=\"Merge $src into $dst\";\
while getopts \":b:t:h\" o; do\
case \"$o\" in\
b) dst=$OPTARG; title=\"Merge $src into $dst\";;\
t) title=$OPTARG;;\
h) usage; return 0;;\
*) usage; return 1;;\
esac;\
done;\
shift $((OPTIND-1));\
git ps && \
curl https://api.bitbucket.org/2.0/repositories/$BITBUCKET_TEAMNAME/$(basename $(git rev-parse --show-toplevel))/pullrequests\
-s\
-u \"$BITBUCKET_USERNAME:$BITBUCKET_PASSWORD\"\
-H 'Content-Type: application/json'\
-d '{\
\"title\":\"'\"$title\"'\",\
\"source\":{\
\"branch\":{\
\"name\":\"'\"$src\"'\"\
}\
},\
\"destination\":{\
\"branch\":{\
\"name\":\"'\"$dst\"'\"\
}\
},\
\"reviewers\":[\
'$(echo -n $@|awk 'BEGIN{RS=\" \"}{print\"{\\\"username\\\":\\\"\"$1\"\\\"}\"}'|paste -sd,)'\
]\
}'\
| jq -r '.links.html.href // .error.message';\
};\
alias_git_pr"
ps = !git pu || ( git pl && git pu )
pu = push -u origin HEAD
rb = rebase
rba = rebase --abort
rbc = rebase --continue
rbd = rebase devel
rbm = rebase master
rbt = rebase test
r = reset
rh = reset --hard
rhh = reset --hard HEAD^
rpo = remote prune origin
s = status
ss = stash save
sp = stash pop
t = tag