Quantcast
Viewing all articles
Browse latest Browse all 11

Answer by yassine dotma for git: rename local branch failed

You can change the name from master to main in few steps, locally before you even make a commit.

  1. Navigate to the directory where your project sits.
  2. In it, show hidden file since by default, .git would be hidden.
  3. Inside .git, there is a file, HEAD, open it in a text editor.You'd see, ref: refs/heads/master.
  4. Simple enough, change, master to main.

We just renamed the master branch as main. Verify this merely by entering, git branch from the terminal.


Viewing all articles
Browse latest Browse all 11

Trending Articles