JJ123
JJ123

Reputation: 644

Why can't I make a pull request even when doing everything from scratch?

I have a few folders that I want to upload to github. These are the steps I took in order to that:

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

Answers (2)

VonC
VonC

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

Daniel
Daniel

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

Related Questions