GitHub上的HTTP 403拉取请求 [英] HTTP 403 on GitHub pull request

查看:483
本文介绍了GitHub上的HTTP 403拉取请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想提交我的第一个(有史以来的)GitHub拉取请求,这样做遇到了一些困难.

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
  • 进行我的更改
  • git commit -a -m "Closes theuser/therepo/#100"
  • 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.

如果我正确地阅读了该文章(上面已链接),那么接下来我需要做的就是推动分支,以便继续进行步骤2(在分支"菜单中,选择包含您的提交的分支.).

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.).

所以我做一个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),或者它们是分开的?我的策略(推动分支)错了吗?我很困惑.

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.

推荐答案

如果您是该项目的贡献者,则这些说明将起作用,而您却没有.因此,您需要先分叉.阅读分叉回购.克隆叉子,在其中建立分支,推送并然后提交拉取请求.

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.

使用提取请求.

这篇关于GitHub上的HTTP 403拉取请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆