I have my code on my local computer. I created a github repository. I wanted to upload my local code to this remote github repository. This is what I did on terminal:
- I went to the directory of my code from terminal
Then I type:
>git init
>git add .
>git commit -m "First commit"
>git remote add origin https://github.com/usergithub/repository_name.git
Then I went to my github repository and I saw a new branch:
So I click on the green button to make a pull request:
But there is nothing there I can do to merge these 2 branches?
How can I merge the branch to my main project?
I tried different stuff from the terminal:
git push --force origin main
But I get this error message:
error: src refspec main does not match any
error: failed to push some refs to 'https://github.com/usergithub/repository_name.git'


mainto merge with? Or is it the default empty branch github provides? In the latter case, you don't need to merge, just rename one of your two branches to the other.mainto push. You could overwrite remotemainwithgit push -f origin master:mainthough, but remotemainbranch's contents would be lost (not a problem if it's empty of course). And you would still have a discrepancy, with a remotemainand a localmaster. You'd better settle on either name and delete the other one.master, just delete the other withgit push origin :main. If you prefermain, rename your local master withgit branch -m master mainthen push it normally.