#github /

How to Contribute Code Gracefully on GitHub

GitHub is more than just a code hosting platform. Its real value lies in participating in open-source projects and contributing code. This article introduces a basic yet standard GitHub contribution workflow in the simplest way.

Fork the Project

  1. Open the target project’s homepage
  2. Click Fork in the top-right corner
  3. The project will be copied to your own account

Clone to Local

git clone https://github.com/your-username/project-name.git
cd project-name

Create a Branch

Do not modify code directly on the main branch.

git checkout -b feature/xxx

Modify and Commit

git add .
git commit -m "feat: describe what you changed"

Push and Open a PR

git push origin feature/xxx

Then go to the GitHub page and click Pull Request, and fill in a brief description.


Wait for Review and Merge

Update your code according to the maintainer’s feedback. Once the PR is approved and merged, your contribution is complete.

Like this post? Tweet to share it with others or open an issue to discuss with me!