• Home
  • About
    • refraction-ray photo

      refraction-ray

      Blog of thoughs and archive of experience

    • Learn More
  • Posts
    • All Posts
    • Tags Archive
    • Posts Archive
  • Projects
  • RSS

Stay with master branch

04 Oct 2020

  • Introduction
  • GitHub

Introduction

There is a discussion on GitHub about why or why not to replace master as the default branch name. I don’t want to comment on this topic, but my personal choice is to stick with master branch on both my old projects and new projects in the future. Therefore, in this very short post, I make a note on how to maintain master branch on GitHub (and possibly on git if git itself shifts the default from master to main in the future).

GitHub

  • General setup: go to [https://github.com/settings/repositories], under “Repository default branch”, delete main and fill in master, click Update button, DONE.
  • For individual repo:, one could first create an empty repo on GitHub which essentially has no branch information. And we just git push -u origin master as before. Just ignore the instruction given by GitHub on the repo page such as git branch -M main, and go through the exact same workflow as before.


misc