-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbranch.zsh
129 lines (109 loc) · 2.04 KB
/
branch.zsh
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
function branch-push() {
BC=$(git bc);
if [ $BC != "main" ]; then
git push me $BC $1 --no-verify;
fi
}
function branch-push-force() {
BC=$(git bc);
if [ $BC != "main" ]; then
git push me $BC --force --no-verify;
fi
}
function branch-update() {
BC=$(git bc);
if [ $BC != "main" ]; then
git co main;
git rpull;
git co $BC;
branch-reset main;
fi
}
function branch-merge() {
BC=$(git bc);
if [ $BC != "main" ]; then
git co main;
git rpull;
git co $BC;
git r main;
git co main;
git r $BC;
git r origin/main --ignore-date;
fi
}
function branch-track() {
BC=$(git bc);
if [ $BC != "main" ]; then
git push -u origin $BC;
fi
#echo "https://github.etsycorp.com/Engineering/Etsyweb/compare/$BC";
}
function branch-deploy() {
BC=$(git bc);
if [ $BC == "main" ]; then
git rpull;
git push origin main;
fi
}
function m() {
git checkout main;
}
function branch-destroy() {
BC=$(git bc);
if [ $BC != "main" ]; then
git checkout "main";
git branch -D $BC;
fi
}
function branch-destroy-remote() {
git_clean_review --checkallremotes;
}
function branch-sleep() {
BC=$(git bc);
if [ $BC != "main" ]; then
git checkout -b "zz-$BC";
git branch -d $BC;
fi
}
function branch-new() {
git co "main"
if [ $1 != "" ]; then
git cob $1;
fi
}
function branch-clone() {
if [ $1 != "" ]; then
g cob jlaster-$1;
fi
}
function branch-rename() {
BC=$(git bc);
if [ $1 != "" ]; then
g cob jlaster-$1;
g bd $BC;
fi
}
function branch-reset() {
SHA=$(git rev-parse HEAD);
if [ $1 != "" ]; then
git reset --hard $1;
git cp $SHA;
fi
}
function branch-awake() {
}
function remote-add() {
git remote add $1 https://github.com/$1/debugger.html.git
}
function search() {
g g -e "$1";
}
alias bp="branch-push"
alias bpf="branch-push-force"
alias bc="branch-clone"
alias bn="branch-new"
alias bu="branch-update"
alias bm="branch-merge"
alias bt="branch-track"
alias bd="branch-destroy"
alias br="branch-reset"