💾 Archived View for darknesscode.xyz › notes › move-master-branch-to-main.gmi captured on 2023-11-04 at 11:30:11. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-17)

-=-=-=-=-=-=-

Move master branch to main

This steps works for Github, Gitlab and your own git server.

Move the master branch to main

git branch -m master main

Push main

git push -u origin main

Point HEAD to main

git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main

Change the default branch in (github, gitlab or git server)

Follow the instructions in your git provider to change the defual master

Delete master branch

git push origin --delete master

Check branch

git branch -a

You should have an output like


  remotes/origin/HEAD -> origin/main
  remotes/origin/main

That's it... you chanched the master branch to main

----------

Home

Linux

Notes

MicroLog

----------

© DarknessCode - LinuxSucks