-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathgg-issues-close
executable file
·39 lines (35 loc) · 1.08 KB
/
gg-issues-close
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
#!/bin/bash
installPath=/usr/local/bin/gg
source $installPath/gg-functions
testClear
get_currentBranch
get_currentBranchType
if [[ $currentBranchType != 'issues' ]]; then
printf "You must be in one issues branch!\n\n"
git status
exit 1
fi
get_father
if [[ -z `git branch | grep -v $currentBranch | grep $father` ]]; then
get_develop
echo "do not know which branch to merge into, please input[default is $develop]:"
git --no-pager branch
read temp
if [[ -z $temp ]]; then
father=$develop
else
father=$temp
fi
fi
echo "You are in branch || $currentBranch ||"
echo "Do you want to close it like this?"
gggttt;echo "git checkout \"$father\""
gggttt;echo "git merge --no-ff \"$currentBranch\""
gggttt;echo "git branch -d \"$currentBranch\""
echo "press ENTER to continue, press Ctrl+c to ESCAPE"
read temp
git checkout "$father"
git merge --no-ff "$currentBranch" -m "Merge issue branch $currentBranch into $father"\
&& echo "press Enter to delete $currentBranch branch"\
&& echo "press Ctrl+c to ESCAPE" \
&& read temp && git branch -d "$currentBranch"