Rename default branch to ‘main’.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-08-31 15:15:31 -07:00
committed by Anders Kaseorg
parent 1c3517a5de
commit 646c04eff2
60 changed files with 218 additions and 218 deletions

View File

@@ -15,7 +15,7 @@ branch=$1
branch_ref=$(git rev-list --max-count=1 "$branch") || error_out "Unknown branch: $branch"
if [ "$old_ref" == "$branch_ref" ]; then
new_ref=master
new_ref=main
else
if ref_name=$(git describe --all --exact "$old_ref"); then
new_ref=$(echo "$ref_name" | perl -pe 's{^(heads|remotes)/}{}')
@@ -28,10 +28,10 @@ fi
git fetch -p
git rebase origin/master "$branch" || error_out "Rebase onto origin/master failed"
git rebase origin/main "$branch" || error_out "Rebase onto origin/main failed"
git push . HEAD:master
git push origin master || error_out "Push of master to origin/master failed"
git push . HEAD:main
git push origin main || error_out "Push of main to origin/main failed"
git checkout "$new_ref"
git branch -D "$branch"