关于如何给 github 上其他仓库贡献代码

来源:互联网 发布:linux的home目录 编辑:程序博客网 时间:2024/06/17 12:48

see link:
https://zhuanlan.zhihu.com/p/23457016

步骤就是:

1 . 先fork该仓库的代码到自己的github仓库

2 . 然后clone自己仓库的代码到本地

3 . 然后添加别人仓库地址到本地的 upstream:

git remote add upstream https://github.com/PROJECT_USERNAME/PROJECT.git

并从别人的仓库更新自己的代码到最新:

git pull upstream master  // 或者其他分支

4 . 然后就是修改代码:

 git add . && git commit ...

5 . 然后将代码提交到自己的 github 仓库:

git push origin master // 或者其他分支

6 . 然后再到 自己 github 中去点 New pull request

7 . 然后 creat pull request,并等待作者确认。

0 0