File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ remoteList=("origin" "mmdapl" "chufan443" "lir0115")
12
12
current_branch=$( git rev-parse --abbrev-ref HEAD)
13
13
14
14
15
- # 判断分支名称
15
+ # master分支同步
16
16
if [ " $current_branch " = " master" ]; then
17
17
18
18
# 合并next分支内容到master分之
@@ -21,9 +21,16 @@ if [ "$current_branch" = "master" ]; then
21
21
# 推送到每个远程仓库
22
22
for repoName in " ${remoteList[@]} "
23
23
do
24
- echo " Pushing to $repoName ..."
24
+ echo " --> Pushing to $repoName in master branch ..."
25
25
git push " $repoName " master
26
26
done
27
+ # next分支同步
28
+ elif [ " $current_branch " = " next" ]; then
29
+ for repoName in " ${remoteList[@]} "
30
+ do
31
+ echo " -->Pushing to $repoName in next branch..."
32
+ git push " $repoName " next
33
+ done
27
34
else
28
- echo " 当前分支是:$current_branch ,只允许在master分支上操作 ,并推送到远程!!!"
35
+ echo " 当前分支是:$current_branch ,只允许在master和next分支上操作 ,并推送到远程!!!"
29
36
fi
You can’t perform that action at this time.
0 commit comments