GitHub拉取请求上的HTTP 403

时间:2015-03-14 01:44:58

标签: git github pull-request

我想提交我的第一个(永远)GitHub拉取请求,并且遇到了一些困难。

根据this article我必须首先创建一个分支。所以我:

  • git clone https://github.com/theuser/therepo.git
  • git branch mybranch
  • git checkout mybranch
  • 进行更改
  • git commit -a -m "Closes theuser/therepo/#100"

我的想法(如果错误请纠正我)是克隆回购,制作分支并将更改提交给该分支。

如果我正确地阅读那篇文章(上面已经链接过),那么接下来我需要做的就是推动分支,以便我可以继续进行第2步(在"分支& #34;菜单,选择包含提交的分支。)。

所以我做了git push我得到了:

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://myuser@github.com':
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

我无法说出这里发生了什么?是第一个警告/错误(抱怨push.default)导致第二个错误(HTTP 403),还是它们是分开的?我的策略(推动分支)是错误的吗?我很困惑。

1 个答案:

答案 0 :(得分:7)

如果您是该项目的贡献者,这些说明将有效,但您不是。所以你需要先分叉。阅读Fork a Repo。克隆你的fork,在那里创建分支,然后按然后提交pull请求。

您的存储库与其存储库的确没有明确说明,但如果您从文章开始,然后单击用于创建分支的链接,则最终会在Creating and deleting branches within your repository。强调我的。

Using Pull Requests中有两种不同的协作模型(Fork& Pull vs. Shared Repository)。