Skip to content

Commit acaa3de

Browse files
committed
fix: 修复sync脚本同步异常,支持main作为默认分支
1 parent 7d5aebb commit acaa3de

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/sync

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ current_branch=$(git rev-parse --abbrev-ref HEAD)
1313

1414

1515
# master分支同步
16-
if [ "$current_branch" = "master" ]; then
16+
if [ "$current_branch" = "main" ]; then
1717

1818
# 合并next分支内容到master分之
1919
git merge origin/next
@@ -22,7 +22,7 @@ if [ "$current_branch" = "master" ]; then
2222
for repoName in "${remoteList[@]}"
2323
do
2424
echo "-->Pushing to $repoName in master branch..."
25-
git push "$repoName" master
25+
git push "$repoName" main
2626
done
2727
# next分支同步
2828
elif [ "$current_branch" = "next" ]; then
@@ -33,4 +33,4 @@ elif [ "$current_branch" = "next" ]; then
3333
done
3434
else
3535
echo "当前分支是:$current_branch ,只允许在master和next分支上操作,并推送到远程!!!"
36-
fi
36+
fi

0 commit comments

Comments
 (0)