Migrate Master Branch to Main
Published on 04 Sep 2022
In order to replace your master
branch and start using main
instead. I found this steps be the simplest way to do it:
-
Create the
main
branch locally, taking the history from mastergit branch -m master main
-
Push the new local main branch to the remote repo
git push -u origin main
-
Switch the current HEAD to the main branch
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
-
Change the default branch on Github/Gitlab to main
-
Delete the master branch on the remote
git push origin --delete master
Why should I change master to main? Wikipedia Article
all tags
IDE architecture" cli crontab crypto csv database docker editor error exceptions fastapi ffmpeg filename git go history http iteration javascript linux logging me mysql numpy orm pdo pentaho php postgres python random rename rsync rust selenium server solana sql sqlite ssh typescript user w3m wordpress