smeeb
smeeb

Reputation: 29507

Fork and Pull Method Not Working on GitHub

I am new to git and GitHub (where my username is myuser). I am trying to submit my first ever pull request and am running into some issues.

  1. I forked a repo of a project that I need to patch, called someuser/somerepo. Hence, I now have a myuser/somerepo repo.
  2. I cloned my fork locally and created a branch (mybranch).
  3. I made various changes to mybranch.
  4. I ran git commit -a -m "Closes someuser/somerepo/#10"
  5. Then I ran git push, where I was asked to authenticate.

After the successful git push, I see:

So, off the cuff, it seemms like I've actually managed to do everything correctly so far. So I Googled "GitHub how to pull request" and I found this GitHub wiki article.

According to that article I need to go into GitHub, and from "the repository from which I'd like to propose changes", I need to choose the mybranch option from the Branches menu.

However, I do not see mybranch, I only see the branches that existed in the repo that I forked. This tells me I missed something.

So I have to ask (because they are all similarly related):

  1. Have I missed anything or overlooked anything? I am not a 'member' of the somerepo repo, I have never contacted any of its maintainers; I guess I'm wondering if I don't even have permission to do a pull request. In which case my question would be: how does the GitHub repo authorization model work? (what users can do what to a repo)?
  2. What decides whether one "forks and pulls" or goes with a "shared repo"? Do pull requests occur in both situations?

Ultimately: What's my next step here, and how do I fix this so I can continue putting in my pull request?

Upvotes: 0

Views: 1181

Answers (2)

Яois
Яois

Reputation: 3858

Seems like you haven't pushed your branch up to your fork repository, try doing:

git push -u origin mybranch

Here I'm assuming your remote is origin (as by default). If not, use your remote's name instead of origin.

EDIT:

I think there are some conditions (non fast-forward changes) in which your changes in a local branch will be pushed to the "default" remote branch (usually master) when you don't specify the destination branch (i.e. by doing git push), but of course this may be not your case at all :)

If you want to make sure your changes are in mybranch, try the url

https://github.com/[user-name]/[repo-name]/tree/mybranch

It should show you your uploaded branch.

Hope that it helps!

Upvotes: 1

DVG
DVG

Reputation: 17480

You are super close. You actually want to go to your fork, click pull requests on the right, and click new to start the process

Upvotes: 1

Related Questions