如何向开源社区贡献代码

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/shida_csdn/article/details/82591787

一、流程图

首先,fork 源项目到自己的GitHub代码仓库,之后通过 fetch 同步代码;

然后,clone fork 的项目,本地修改后 push 提交(最好基于新分支);

最后,提交 pull request 等待审核。

二、git 操作记录

git clone <自己账户下 fork 的代码>

git remote add up <开源项目源地址>

git checkout master 

git fetch up master  // 从开源项目地址拉取最新master分支代码

git merge up/master  // 合并代码到本地

扫描二维码关注公众号,回复: 3175313 查看本文章

git push -u origin master  // 将最新代码推送到远端

git checkout -b fix-xxxx  // 建立新分支

git add xxx  //添加修改

git commit -m "描述"

git push -u origin fix-xxxx  // 推送修改后的代码到 fix-xxxx 分支

猜你喜欢

转载自blog.csdn.net/shida_csdn/article/details/82591787