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?
You can either git merge master or git rebase master . If the branch has not been distributed to other people, in this case i would prefer git rebase. Because git rebase makes it as if the changes on the feature branch were made on top of the changes on the master branch, which makes the version graph simpler.
In GitHub Desktop, click Current Branch. Click Choose a branch to merge into BRANCH. Click the branch you want to merge into the current branch, then click Merge BRANCH into BRANCH. Note: If there are merge conflicts, GitHub Desktop will warn you above the Merge BRANCH into BRANCH button.
git merge master will update your current branch with the changes from your local master branch, the state of which will be that of when you last pulled while on that branch.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With