From a9189243d84cc04c8578ca9f8bd53a494822f74d Mon Sep 17 00:00:00 2001 From: "142vip.cn" Date: Wed, 15 Nov 2023 19:28:16 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(scripts):=20=E6=96=B0=E5=A2=9Esync?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=EF=BC=8C=E5=90=8C=E6=AD=A5master=E5=88=B0?= =?UTF-8?q?=E4=B8=8D=E5=90=8C=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/release | 2 +- scripts/sync | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100755 scripts/sync diff --git a/scripts/release b/scripts/release index b24f78126..3316fe337 100755 --- a/scripts/release +++ b/scripts/release @@ -19,7 +19,7 @@ current_branch=$(git rev-parse --abbrev-ref HEAD) if [ "$current_branch" = "next" ]; then bumpp --preid alpha --execute="$generateChangeLog" --commit "$commitInfo" --all --tag --push else - echo "当前分支是:$current_branch ,版本迭代允许在next分之操作,并推送到远程!!!" + echo "当前分支是:$current_branch ,版本迭代允许在next分支操作,并推送到远程!!!" fi diff --git a/scripts/sync b/scripts/sync new file mode 100755 index 000000000..f9dac7793 --- /dev/null +++ b/scripts/sync @@ -0,0 +1,29 @@ +#!/bin/bash + +## +## 同步分支脚本 +## 使用: ./scripts/sync +## + + +# 远程仓库名称 +remoteList=("mmdapl" "chufan443" "lir0115") +# 获取当前分支名称 +current_branch=$(git rev-parse --abbrev-ref HEAD) + + +# 判断分支名称 +if [ "$current_branch" = "master" ]; then + + # 合并next分支内容到master分之 + git merge origin/next + + # 推送到每个远程仓库 + for repoName in "${remoteList[@]}" + do + echo "Pushing to $repoName..." + git push "$repoName" master + done +else + echo "当前分支是:$current_branch ,只允许在master分支上操作,并推送到远程!!!" +fi \ No newline at end of file From ac5379b38129becb4cc199dbafd464807626ed14 Mon Sep 17 00:00:00 2001 From: "142vip.cn" Date: Wed, 15 Nov 2023 19:33:17 +0800 Subject: [PATCH 2/3] chore: update --- scripts/sync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/sync b/scripts/sync index f9dac7793..b39127c82 100755 --- a/scripts/sync +++ b/scripts/sync @@ -7,7 +7,7 @@ # 远程仓库名称 -remoteList=("mmdapl" "chufan443" "lir0115") +remoteList=("origin","mmdapl" "chufan443" "lir0115") # 获取当前分支名称 current_branch=$(git rev-parse --abbrev-ref HEAD) From 63b3b4d00aafdffc8ab92ee2feba204c35826e2b Mon Sep 17 00:00:00 2001 From: "142vip.cn" Date: Wed, 15 Nov 2023 19:35:02 +0800 Subject: [PATCH 3/3] chore(sync): update --- scripts/sync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/sync b/scripts/sync index b39127c82..77c814a12 100755 --- a/scripts/sync +++ b/scripts/sync @@ -7,7 +7,7 @@ # 远程仓库名称 -remoteList=("origin","mmdapl" "chufan443" "lir0115") +remoteList=("origin" "mmdapl" "chufan443" "lir0115") # 获取当前分支名称 current_branch=$(git rev-parse --abbrev-ref HEAD)