简体   繁体   English

如何继续为开源项目做出贡献?

[英]How to continue contributing to open-source projets?

The first time I contribute to an open-source project, I 我第一次为开源项目做贡献时,

  • fork the public repository into my own repository 将公共存储库分叉到我自己的存储库中
  • make a branch on my own repository 在我自己的存储库中建立分支
  • make the changes on my own repository 在我自己的存储库中进行更改
  • create an issue and/or pull request on the public repository 在公共存储库上创建问题和/或拉取请求
  • wait until it is merged on the public repository 等到它合并到公共存储库上

I am now at this point. 我现在在这一点上。

To contribute to the same project again, what do I do? 要再次为同一项目做出贡献,我该怎么办? (If it matters, I am using GitLab and the public repository is also hosted on GitLab) (如果重要,我使用的是GitLab,公共存储库也托管在GitLab上)

I could fork the project again into another repository, but this means I would have many copies of the same repository under my account. 我可以将项目再次分叉到另一个存储库中,但这意味着我的帐户下将拥有同一存储库的许多副本。

I could set up repository mirroring (GitLab feature that pulls hourly from the public repository into my own repository), but all commits are counted under "My activity" on the graph. 我可以设置存储库镜像(GitLab功能,每小时将其从公共存储库拉到我自己的存储库中),但是所有提交都计入图表的“我的活动”下。

What is the standard procedure to contribute to an open-source project in which I am not a developer in the public project and already have an outdated, forked version? 如果我不是公共项目的开发人员并且已经拥有过时的分叉版本,那么对开源项目做出贡献的标准程序是什么?

You can reuse your fork, since you can update it with the content of "upstream" , with "upstream" being the name of the original remote repo (the one you have forked initially) 您可以重复使用fork, 因为可以使用“ upstream”的内容对其进行更新 ,其中“ upstream”是原始远程仓库(最初为您创建的仓库)的名称。

cd /path/to/your/fork/clone
git add upstream /url/original/repo
git fetch upstream

git checkout -b newBranch upstream/master  
git push -u origin newBranch

You now have a new branch, based on the very latest of upstream/master, from which you can: 现在,您将基于最新的上游/主服务器创建一个新分支,从中可以:

  • make new commits 做出新的承诺
  • push to your fork 推到你的叉子
  • make a new pull request from said new branch back to the original "upstream" repo. 从所述新分支发出新的拉取请求,将其返回到原始“上游”存储库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为github上的开源项目做贡献 - Contributing to open source project on github 如何更新开源代码的修改版本? - How to update a modified version of an open-source code? 为开源 git 存储库做出贡献的工作流程是什么? - What is the workflow for contributing to an open source git repository? 如何使用源代码管理管理同一项目的开源和商业版本? - How do I manage an open-source and commercial version of the same project using source control? 如何在开源开发期间模糊数据库身份验证信息? - How can I obfuscate database authentication info during open-source development? 从压缩的开源 GitHub 下载编译 Xcode 项目 - Compiling Xcode project from zipped open-source GitHub download 在(上游)开源项目之上维护其他功能 - Maintaining additional features on top of an (upstream) open-source project 通过GitHub提交拉取请求的正确方法(在贡献开源时) - Proper way to submit pull request via GitHub (when contributing to open source) Git从上游发散,但继续为上游做贡献 - Git diverge from upstream but continue contributing to upstream 工作流程:git 带有功能分支、变基、拉取请求(非开源项目) - Workflow: git with feature branches, rebase, pull requests (not open-source project)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM