简体   繁体   中英

Merging master into main branch

I am attempting these days to have my master branch into my main branch (so I can start using as the default one), however, I am not being able to make it in GitHub.

After trying to open a pull request git does not detect differences between them and does not let me do the merging, although checking each branch, you can see all files from my project in the master and nothing in the main.

What can I do to fix it and why does this happen?

It is better to follow the " Renaming the default branch from master " official GitHub guide: there will be a native GitHub feature to do that in January 2021.

But if you don't have any pending pull requests, draft releases or branch protection policies, then you can

git switch -c main master
git push -u origin main

(Change the default branch if the remote repository )

git push -d master
git branch -d master

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM