Reputation: 644
I have a few folders that I want to upload to github. These are the steps I took in order to that:
git init
git remote add origin <https link of the git repository>
git add <name of the folder I want to push>
git commit -m "commit message"
git push origin master
I opened github.com to make a pull request but it won't let me do it. I have attached the screenshots from github. I tried this process multiples times by deleting ".git" file but the problem remains. The create pull request
button is not highlighted due to which I can't make a pull request. Will you please let me know what's going on and how to fix it?
pic 1
pic 2
Upvotes: 1
Views: 1328
Reputation: 1323115
Since you have only push master
, GitHub would consider that your default branch (which, initially, was main
on GitHub side)
As mentioned in Pull Request
Pull request pages show the diff between
- the tip of the head ref and
- the common ancestor of the head and base ref at the time when the pull request was created.
But here, you have pushed only one branch.
There is no common ancestor between master
and anything else (including the unborn main
branch)
You would need to create a new branch locally, with new commits, to be able to push it, and make a PR from it.
Upvotes: 3
Reputation: 1134
When sharing a locally created branch to a remote you need to use git push -u origin master
, where -u
is short for --set-upstream
Upvotes: 0