GitHub 的 试用说明
来源:互联网 发布:西方伦理思想史淘宝 编辑:程序博客网 时间:2024/06/05 03:41
我尝试用类比的方法来解释一下 pull reqeust。想想我们中学考试,老师改卷的场景吧。你做的试卷就像仓库,你的试卷肯定会有很多错误,就相当于程序里的 bug。老师把你的试卷拿过来,相当于先 fork。在你的卷子上做一些修改批注,相当于 git commit。最后把改好的试卷给你,相当于发 pull request,你拿到试卷重新改正错误,相当于 merge。
当你想更正别人仓库里的错误时,要走一个流程:- 先 fork 别人的仓库,相当于拷贝一份,相信我,不会有人直接让你改修原仓库的
- clone 到本地分支,做一些 bug fix
- 发起 pull request 给原仓库,让他看到你修改的 bug
- 原仓库 review 这个 bug,如果是正确的话,就会 merge 到他自己的项目中
至此,整个 pull request 的过程就结束了。
理解了 pull request 的含义和流程,具体操作也就简单了。以 Github 排名最高的 https://github.com/twbs/bootstrap 为例说明。
1. 先点击 fork 仓库,项目现在就在你的账号下了
<img src="https://pic3.zhimg.com/6aaed35908e74de871fcbed7c5affb0e_b.png" data-rawwidth="2010" data-rawheight="506" class="origin_image zh-lightbox-thumb" width="2010" data-original="https://pic3.zhimg.com/6aaed35908e74de871fcbed7c5affb0e_r.png">
2. 在你自己的机器上 git clone 这个仓库,切换分支(也可以在 master 下),做一些修改。
~ git clone https://github.com/beepony/bootstrap.git~ cd bootstrap~ git checkout -b test-pr~ git add . && git commit -m "test-pr"~ git push origin test-pr
<img src="https://pic2.zhimg.com/3e1ac7f58774a79a5dd6bf8e852e4199_b.png" data-rawwidth="2010" data-rawheight="476" class="origin_image zh-lightbox-thumb" width="2010" data-original="https://pic2.zhimg.com/3e1ac7f58774a79a5dd6bf8e852e4199_r.png">4. 添加一些注释信息,确认提交4. 添加一些注释信息,确认提交
<img src="https://pic3.zhimg.com/f5ed68dfe4d60fe90e2fb22ec1933006_b.png" data-rawwidth="1658" data-rawheight="1294" class="origin_image zh-lightbox-thumb" width="1658" data-original="https://pic3.zhimg.com/f5ed68dfe4d60fe90e2fb22ec1933006_r.png">5. 仓库作者看到,你提的确实是对的,就会 merge,合并到他的项目中
5. 仓库作者看到,你提的确实是对的,就会 merge,合并到他的项目中
以上就是 pull reqesut 的整个流程,希望对你有帮助~
参考文档:Fork A Repo - User Documentation
Using pull requests
Creating a pull request
链接:https://www.zhihu.com/question/21682976/answer/79489643
阅读全文
0 0
- GitHub 的 试用说明
- photobucket试用说明
- Android Studio试用说明
- Android Studio试用说明
- github说明
- Github安装到windows7的配置说明
- github上cocos2dx的说明文档
- github上项目的目录结构说明
- monkey script相关试用说明
- 基于Code_Collaborator和Review_board的代码审工具试用对比说明
- GitHub的各标签的功能说明以及使用方法
- github空间配额说明
- github操作说明
- Github添加图片说明
- GitHub 角色说明
- SWFObject.js试用方法参数说明
- ArcGIS Desktop软件安装和试用说明
- 试用我的Gmail
- spring-boot-multi-datasource(spring-boot多路数据源)
- Ubuntu14.04下Vim的安装与配置
- 异常数据剔除
- 1.Android注解-编译时生成代码 APT(Annotation Processing Tool ) Poet 说明
- CSS 变量教程
- GitHub 的 试用说明
- JNI WARNING: NewStringUTF input is not valid Modified UTF-8: illegal start byte 0xb0
- C#调用非托管DLL(数据类型)
- Php-mysql中的子查询(V客学院知识分享)
- 解决No Hibernate Session bound to thread, and configuration does not allow creation of non-transaction
- 我们的社交不始于腾讯
- JDBC为什么要使用PreparedStatement而不是Statemen
- Ubuntu16.04下面的vs code出现Unable to activate CppCheck analyzer
- MYSQL-对varchar类型字段(都是数字)按照整数大小倒序排列