本文介绍了如何执行 GitHub 拉取请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何创建和/或向托管在 GitHub 上的另一个存储库发送拉取请求?
How do I create and/or send a pull request to another repository hosted on GitHub?
推荐答案
要了解如何发出拉取请求,我只关注了 Github 上的两个单独的帮助页面(以下链接为要点).以下命令行命令适用于第 1 部分.第 2 部分,即实际的拉取请求,完全在 Github 的网站上完成.
To learn how to make a pull request I just followed two separate help pages on Github (linked below as bullet points). The following command line commands are for Part 1. Part 2, the actual pull request, is done entirely on Github's website.
$ git clone https://github.com/tim-peterson/dwolla-php.git
$ cd dwolla-php
$ git remote add upstream https://github.com/Dwolla/dwolla-php.git
$ git fetch upstream
// make your changes to this newly cloned, local repo
$ git add .
$ git commit -m '1st commit to dwolla'
$ git push origin master
第 1 部分:fork 某人的仓库:https://help.github.com/articles/fork-a-repo
Part 1: fork someone's repo: https://help.github.com/articles/fork-a-repo
- 点击您想要贡献的存储库上的fork"按钮,在本例中:Dwolla 的 PHP 存储库 (Dwolla/dwolla-php)
- 获取新创建的分支的 URL,在本例中:https://github.com/tim-peterson/dwolla-php.git (tim-peterson/dwolla-php)
- 输入
git clone->cd dwolla-php->git remote->git fetch
序列以将您的 fork 克隆到您计算机中的某个位置(即复制/粘贴"它在这种情况下:third_party TimPeterson$
) 并将其与主存储库 (Dwolla/dwolla-php) 同步 - 对本地存储库进行更改
- 键入上面的
git add->git commit->git push
序列以将您的更改推送到远程存储库,即您在 Github 上的分支 (tim-peterson/dwolla-php)
- click the 'fork' button on the repo you want to contribute to, in this case: Dwolla's PHP repo (Dwolla/dwolla-php)
- get the URL for your newly created fork, in this case: https://github.com/tim-peterson/dwolla-php.git (tim-peterson/dwolla-php)
- type the
git clone->cd dwolla-php->git remote->git fetch
sequence above to clone your fork somewhere in your computer (i.e., "copy/paste" it to, in this case:third_party TimPeterson$
) and sync it with the master repo (Dwolla/dwolla-php) - make your changes to your local repo
- type the
git add->git commit->git push
sequence above to push your changes to the remote repo, i.e., your fork on Github (tim-peterson/dwolla-php)
第 2 部分:发出拉取请求:https://help.github.com/articles/using-pull-requests
- 转到 Github 上您的叉子 网页 (https://github.com/tim-peterson/dwolla-php)
- 点击拉取请求"按钮
- 为拉取请求命名,填写您所做更改的详细信息,点击提交按钮.
- 大功告成!!
这篇关于如何执行 GitHub 拉取请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!