Move default branch from "master" -> "main"
See original GitHub issue@jrbourbeau and I are in the process of moving the default branch for this repo from master to main.
- Changed in GitHub
- Merged PR to change branch name in code. #245
What you’ll see
Once the name on github is changed (the first box above is Xed, or this issue closed), when you try to git pull
you’ll get
Your configuration specifies to merge with the ref 'refs/heads/master'
from the remote, but no such ref was fetched.
What you need to do
First: head to your fork and rename the default branch there Then:
git branch -m master main
git fetch origin
git branch -u origin/main main
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:11 (11 by maintainers)
Top Results From Across the Web
5 steps to change GitHub default branch from master to main
Step 1 - Move the master branch to 'main' · Step 2 - Push 'main' to remote repo · Step 3 - Point...
Read more >git how to change default branch for everything I do?
2 Answers 2 · rename your local branch from master to main: git branch -m master main · push to main: git push...
Read more >How to rename the "master" branch to "main" in Git
Today, many teams want to move away from 'master' as the name of their default Git branch. Find out how to rename your...
Read more >Git: Moving from Master to Main
Copy the master branch and history to main · Push main to the remote repository, i.e. GitHub / GitLab · Point HEAD to...
Read more >How to change a GitHub repo from master to main
If you go to the main repo page on GitHub and select the branches dropdown menu, you will see two branches listed and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The release is complete, just FYI.
It might be worth opening issues as permissions in RtD are a little more ad-hoc than GitHub. There are no orgs so folks have to be added to each project manually.
Perhaps @jrbourbeau or @mrocklin have been added to enough projects to be able to go through and fix everything? But I do not.