我如何创建和/或发送一个拉请求到另一个存储库托管在GitHub?
当前回答
我已经启动了一个项目来帮助人们进行他们的第一个GitHub拉请求。你可以在这里通过实践教程来制作你的第一个PR
工作流程简单如
Fork的回购在github 通过点击克隆回购按钮获得克隆url 打开终端,运行git clone <clone url你之前复制的> 为你所做的更改创建一个分支git checkout -b branch-name 做出必要的改变 git Commit提交你的更改 在GitHub上将你的更改推送到你的fork上git Push origin branch-name 去你的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的新分支。解决方案是在push命令中添加-u:
git push -u origin <branch>
我已经启动了一个项目来帮助人们进行他们的第一个GitHub拉请求。你可以在这里通过实践教程来制作你的第一个PR
工作流程简单如
Fork的回购在github 通过点击克隆回购按钮获得克隆url 打开终端,运行git clone <clone url你之前复制的> 为你所做的更改创建一个分支git checkout -b branch-name 做出必要的改变 git Commit提交你的更改 在GitHub上将你的更改推送到你的fork上git Push origin branch-name 去你的GitHub上的分叉看到一个比较和拉请求按钮 点击它并给出必要的细节
我写了一个bash程序,它为您完成了所有建立公关分支的工作。如果需要,它会执行分叉,与上游同步,设置上游远程等,你只需要提交你的修改,推送和提交PR。
下面是你如何运行它:
github-make-pr-branch ssh your-github-username orig_repo_user orig_repo_name new-feature
你可以在这里找到这个程序,如果你想了解它是如何工作的,它的存储库还包括手动执行相同过程的逐步指南,以及关于如何使用上游主程序和其他有用的花絮来保持你的特性分支的最新信息。
最简单的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.
推荐文章
- RPC失败;卷度传输已关闭,剩余未完成的读取数据
- 我应该在.gitignore文件中添加Django迁移文件吗?
- 错误:您对以下文件的本地更改将被签出覆盖
- Git rebase—即使所有合并冲突都已解决,仍然会继续报错
- 在Git中,我如何知道我的当前版本是什么?
- 跟踪所有远程git分支作为本地分支
- 自定义SSH端口上的Git
- git如何显示不存在于.gitignore中的未跟踪文件
- 在另一个目录中运行操作
- Git错误:遇到7个文件应该是指针,但不是
- GitHub克隆与OAuth访问令牌
- 移动(或“撤销”)最后一个git提交到非暂存区域
- 我可以在GitHub上对要点进行拉请求吗?
- Hg:如何做一个像git的rebase
- 如何丢弃远程更改并将文件标记为“已解决”?