Skip to content

Commit

Permalink
fix: 修复sync脚本同步异常,支持main作为默认分支
Browse files Browse the repository at this point in the history
  • Loading branch information
mmdapl committed Jul 29, 2024
1 parent 7d5aebb commit acaa3de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/sync
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ current_branch=$(git rev-parse --abbrev-ref HEAD)


# master分支同步
if [ "$current_branch" = "master" ]; then
if [ "$current_branch" = "main" ]; then

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

0 comments on commit acaa3de

Please sign in to comment.