This article shows you how to contribute to your first open source project in just five minutes.
First of all, you need a GitHub account to be a contributor.
Generally speaking, you need to go through the following steps to become a contributor:
- Fork a repo
- Clone the repo
- Define a pre-commit hook
- Create a branch
- Read the code and documentation style
- Push changes to GitHub
- Create pull request
- Ask for a code review
Let’s look at the steps one by one with the example of our Nebula Graph repo.
Fork the Nebula Graph repo by clicking on the fork button on the top of the main page. This will create a copy of this repository in your account.
You can see nebula repository is in your repository list. Please be noted the information This branch is 117 commits behind vesoft-inc:master., which indicates the deference between your branch and the master. If you just forked the repository, the information is This branch is even with vesoft-inc:master.
Clone the repository to your local machine. Click the Clone or download button, then click the copy to clipboard icon. Your remote repo on Github is called origin.
Open a terminal and run the following git command:
where “url you just copied” (without the quote marks) is the url to the Nebula Graph repository. See the previous picture to obtain the url. For example:
where nebula-package is the user name.
Please link the Nebula Graph pre-commit hook into your .git directory. This hook checks your commits for formatting, building, doc generation, etc.
Switch to the Nebula Graph repository directory and create a new branch named myfeature to work on!
Edit your code and commit the changes with the following command.
When ready to review (or just to establish an offsite backup or your work), push your branch to your fork on github.com:
- Visit your fork at https://github.com/$user/nebula (replace $user obviously).
- Click the Compare & pull request button next to your myfeature branch.
Once your pull request has been opened, it will be assigned to at least two reviewers. Those reviewers will do a thorough code review to ensure the changes meet the repository’s contributing guidelines and other quality standards.
Once the pull request is approved and merged you can pull the changes from upstream to your local repo and delete your extra branch(es).
You can become a Nebula Graph contributor by contributing code or documentation. This section shows you how to raise doc pr to be our contributor. The follow picture shows the doc toc and you can make changes in any of the .md doc files. Consider the Get Started doc as example.
The above picture shows the change log of the doc. You can add details, fix errors or even rewrite the whole doc to make it more organized and readable.
Please refer to the Documentation Toc to see all the Nebula Graph docs.
Last but not least, you are welcome to try Nebula Graph at our GitHub Repository. If you have any problems or suggestions please raise us an issue.