我想提交我的第一个(有史以来)GitHub Pull 请求,但这样做遇到了一些困难。
根据本文 https://help.github.com/articles/creating-a-pull-request/我必须首先创建一个分支。所以我:
git clone https://github.com/theuser/therepo.git
git branch mybranch
git checkout mybranch
- 做出我的改变
git commit -a -m "Closes theuser/therepo/#100"
我在这里的想法(如果错误请纠正我)是克隆存储库,创建分支并向该分支提交更改。
如果我正确地阅读了那篇文章(上面链接),那么接下来我需要做的就是推送分支,以便我可以继续步骤#2(在“分支”菜单中,选择包含您的提交的分支。).
所以我做了一个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://[email protected] /cdn-cgi/l/email-protection':
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),或者它们是分开的?我的策略(推分支)错了吗?我很困惑。
如果您是该项目的贡献者,这些说明将会起作用,但您不是。所以你需要先分叉。读分叉一个回购协议 https://help.github.com/articles/fork-a-repo/。克隆你的叉子,在那里建立分支,推动并then提交拉取请求。
您的存储库与他们的存储库并没有真正拼写出来,但是如果您从文章开始并单击用于创建分支的链接,您最终会看到创建和删除分支your存储库 https://help.github.com/articles/creating-a-pull-request/。强调我的。
有关两种不同协作模型(Fork & Pull 与共享存储库)的更多信息,请参见使用拉取请求 https://help.github.com/articles/using-pull-requests/.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)