简体   繁体   中英

How to merge master branch into main

I have created a new remote repo "infrastructure" on GitHub.

I have then created a local repo on my computer in the folder "infr" with git init

When I pushed my local repo with git push -u origin master the new branch "master" was created.

I want to merge "master" branch into "main" branch now.

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.

I have tried renaming my "master" branch into "main" but I got an error : "Could not rename branch "master" at this time: New branch already exists".

So how do I merge master into main branch ?

I encountered same problem 4 days ago and what I have done is I opened my online repo in git site and went into repo settings and clicked on branches option. I changed the default branch from main to master and i later deleted the main branch as it was empty. tell me if this works for you. github 仓库设置

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