我如何创建和/或发送一个拉请求到另一个存储库托管在GitHub?
当前回答
对于我们这些拥有github.com帐户的人来说,当我们在命令行中输入“git”时,只会得到一个讨厌的错误消息,下面是如何在你的浏览器中完成这一切:)
Same as Tim and Farhan wrote: Fork your own copy of the project: After a few seconds, you'll be redirected to your own forked copy of the project: Navigate to the file(s) you need to change and click "Edit this file" in the toolbar: After editing, write a few words describing the changes and then "Commit changes", just as well to the master branch (since this is only your own copy and not the "main" project). Repeat steps 3 and 4 for all files you need to edit, and then go back to the root of your copy of the project. There, click the green "Compare, review..." button: Finally, click "Create pull request" ..and then "Create pull request" again after you've double-checked your request's heading and description:
其他回答
对于我们这些拥有github.com帐户的人来说,当我们在命令行中输入“git”时,只会得到一个讨厌的错误消息,下面是如何在你的浏览器中完成这一切:)
Same as Tim and Farhan wrote: Fork your own copy of the project: After a few seconds, you'll be redirected to your own forked copy of the project: Navigate to the file(s) you need to change and click "Edit this file" in the toolbar: After editing, write a few words describing the changes and then "Commit changes", just as well to the master branch (since this is only your own copy and not the "main" project). Repeat steps 3 and 4 for all files you need to edit, and then go back to the root of your copy of the project. There, click the green "Compare, review..." button: Finally, click "Create pull request" ..and then "Create pull request" again after you've double-checked your request's heading and description:
我写了一个bash程序,它为您完成了所有建立公关分支的工作。如果需要,它会执行分叉,与上游同步,设置上游远程等,你只需要提交你的修改,推送和提交PR。
下面是你如何运行它:
github-make-pr-branch ssh your-github-username orig_repo_user orig_repo_name new-feature
你可以在这里找到这个程序,如果你想了解它是如何工作的,它的存储库还包括手动执行相同过程的逐步指南,以及关于如何使用上游主程序和其他有用的花絮来保持你的特性分支的最新信息。
为了进行pull请求,您需要执行以下步骤:
Fork a repository (to which you want to make a pull request). Just click the fork button the the repository page and you will have a separate github repository preceded with your github username. Clone the repository to your local machine. The Github software that you installed on your local machine can do this for you. Click the clone button beside the repository name. Make local changes/commits to the files sync the changes go to your github forked repository and click the "Compare & Review" green button besides the branch button. (The button has icon - no text) A new page will open showing your changes and then click the pull request link, that will send the request to the original owner of the repository you forked.
我花了一段时间才弄明白,希望这能帮助到一些人。
我遵循蒂姆·彼得森的指示,但我为我的更改创建了一个本地分支。然而,在推动后,我没有看到在GitHub的新分支。解决方案是在push命令中添加-u:
git push -u origin <branch>
最简单的GitHub Pull Request来自web界面,不使用git。
Register a GitHub account, login then go to the page in the repository you want to change. Click the pencil icon, search for text near the location, make any edits you want then preview them to confirm. Give the proposed change a description up to 50 characters and optionally an extended description then click the Propose file Change button. If you're reading this you won't have write access to the repository (project folders) so GitHub will create a copy of the repository (actually a branch) in your account. Click the Create pull request button. Give the Pull Request a description and add any comments then click Create pull request button.
推荐文章
- Visual Studio Code无法检测已安装的Git
- 强制LF eol在git的回购和工作副本
- Git:在裸库中更改活动分支的正确方法?
- 删除git中的分支是否会将其从历史记录中删除?
- 防止在GitHub上推送到master ?
- 我如何在github上引用特定问题的评论?
- 根据Git,谁是“我们”,谁是“他们”?
- git如何合并后樱桃采摘工作?
- Git搜索单个文件历史记录中的字符串
- Git命令显示所有(轻量级)标签创建日期
- 我如何才能看到我在Github上看到的所有问题?
- Gitignore并没有忽视文件夹
- 什么时候用。git/info/exclude代替。gitignore来排除文件?
- 如何告诉git忽略个别行,即gitignore为特定行代码
- 在GitHub上链接到其他Wiki页面?