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")
1212current_branch=$( git rev-parse --abbrev-ref HEAD)
1313
1414
15- # 判断分支名称
15+ # master分支同步
1616if [ " $current_branch " = " master" ]; then
1717
1818 # 合并next分支内容到master分之
@@ -21,9 +21,16 @@ if [ "$current_branch" = "master" ]; then
2121 # 推送到每个远程仓库
2222 for repoName in " ${remoteList[@]} "
2323 do
24- echo " Pushing to $repoName ..."
24+ echo " --> Pushing to $repoName in master branch ..."
2525 git push " $repoName " master
2626 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
2734else
28- echo " 当前分支是:$current_branch ,只允许在master分支上操作 ,并推送到远程!!!"
35+ echo " 当前分支是:$current_branch ,只允许在master和next分支上操作 ,并推送到远程!!!"
2936fi
You can’t perform that action at this time.
0 commit comments