简体   繁体   中英

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)

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.

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)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM