Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP 403 on GitHub pull request

I want to submit my first (ever) GitHub pull request and am running into some difficulty doing so.

According to this article I must first create a branch. So I:

  • git clone https://github.com/theuser/therepo.git
  • git branch mybranch
  • git checkout mybranch
  • Make my changes
  • git commit -a -m "Closes theuser/therepo/#100"

My thinking here (please correct me if it was wrong) was to clone the repo, make the branch and commit changes to that branch.

If I'm reading that article (linked above) correctly, then next thing I need to do is push the branch so that I can move on to Step #2 (In the "Branch" menu, choose the branch that contains your commits.).

So I do a git push and I get:

D:\workspace\therepo>git push
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:

    git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

    git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

In Git 2.0, Git will default to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Username for 'https://github.com': myuser
Password for 'https://[email protected]':
remote: Permission to theuser/therepo.git denied to myuser.
fatal: unable to access 'https://github.com/theuser/therepo.git/': The
    requested URL returned error: 403

I can't tell what's going on here? Is the first warning/error (complaining about push.default) causing the second error (HTTP 403), or are they separate? Is my strategy (pushing the branch) wrong? I'm so confused.

like image 443
smeeb Avatar asked Dec 20 '22 06:12

smeeb


1 Answers

Those instructions would work if you were a contributor to that project, but you're not. So you need to fork first. Read Fork a Repo. Clone your fork, make the branch there, push and then submit the pull request.

The your repository vs. their repository isn't really spelled out, but if you look start with your article and click the link for creating a branch you end up at Creating and deleting branches within your repository. Emphasis mine.

There's a bit more about the two different collaboration models (Fork & Pull vs. Shared Repository) in Using Pull Requests.

like image 197
Steven Fisher Avatar answered Dec 30 '22 23:12

Steven Fisher