0%

Submitting a PR to an Open Source Project on GitHub

It’s relatively simple to manage projects on GitHub by oneself, but collaborating and contributing to open source projects is quite interesting. Here, I’llc write my experience in contributing to open source projects, such as inshellisense.

https://static.1991421.cn/2024/2024-03-17-144331.png

Taking the project inshellisense as an example:

  1. Fork the open source project, microsoft/inshellisense => alanhg/inshellisense

  2. Create a new branch, such as fix/file-template, and start development

    • If there are UTs, update them to ensure the tests pass.
    • Here, we do not use the main branch directly because the main branch is used to synchronize project updates to avoid new commits in the original project during development.
    • At the same time, creating a new branch can also better utilize the branch name to indicate whether the changes are a feature or a fix, etc.
  3. Push to the upstream, i.e., alanhg/inshellisense

  4. If the open source project microsoft/inshellisense has updates, pull the updates with Sync fork

  5. Rebase the branch fix/file-template with the main branch to ensure it is up to date

  6. Push again to the upstream alanhg/inshellisense

  7. Initiate a Pull Request, describe the changes in detail, and wait for it to be merged

    • If there are any issues during PR review, actively provide feedback and resolve them
  8. Celebrate 🎉 upon successful merge

  9. You can delete the branch fix/file-template, switch to the main branch, and if you have more contributions to make, repeat the process from step 5