How to Be a GitHub Contributor in Five Minutes
Tags: github, graphdatabase, graphdatabaseindus, nebulagraph
Published: 2020-02-12 07:55:23

---
title: How to Be a GitHub Contributor in Five Minutes
published: true
date: 2020-02-04 02:41:34 UTC
tags: github,graph-database,graph-database-indus,nebula-graph
canonical_url: https://medium.com/nebula-graph/how-to-be-a-github-contributor-in-five-minutes-72175c036c17
---

![](https://cdn-images-1.medium.com/max/1024/1*jC0bsPseevMR5LPNdgujMQ.png)<figcaption>Image by <a href="https://pixabay.com/users/905513-905513/?utm_source=link-attribution&amp;amp;utm_medium=referral&amp;amp;utm_campaign=image&amp;amp;utm_content=1326758">Mary Pahlke</a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;amp;utm_medium=referral&amp;amp;utm_campaign=image&amp;amp;utm_content=1326758">Pixabay</a></figcaption>

This article shows you how to contribute to your first open source project in just five minutes.

### **Before You Start**

First of all, you need a GitHub account to be a contributor.

If you don’t have a [GitHub](https://github.com/) account, or aren’t sure what [Git](https://git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F) is, please refer to the official website first.

### How to Be a GitHub 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
- Develop
- 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 a 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.

![](https://cdn-images-1.medium.com/max/1024/1*IaEydeXZYvtp8wdExvgLHg.png)<figcaption>Fork a repo — Nebula Graph</figcaption>

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.

![](https://cdn-images-1.medium.com/max/1024/1*P7BrI4RieG6fzLRGYc25lQ.png)<figcaption>Fork completed — Nebula Graph</figcaption>

#### Clone the Repository

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.

![](https://cdn-images-1.medium.com/max/1024/1*eG2daqCENZLeCFeYrJ4Vgg.png)<figcaption>Clone a repo — Nebula Graph</figcaption>

Open a terminal and run the following git command:

{% gist https://gist.github.com/Jamie-VESoft/72d6b5948341da149fd842598f185e02 %}

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:

{% gist https://gist.github.com/Jamie-VESoft/52782022323d979b6a0f3806c14aaa96 %}

where nebula-package is the user name.

{% gist https://gist.github.com/Jamie-VESoft/88781bb917bb6b883001e1c35e0234da %}

#### Define a Pre-Commit Hook

Please link the Nebula Graph pre-commit hook into your .git directory. This hook checks your commits for formatting, building, doc generation, etc.

{% gist https://gist.github.com/Jamie-VESoft/e5e5f96223b27175a7c8ba6aae93a19a %}

#### Create a Branch

Switch to the **Nebula Graph** repository directory and create a new branch named myfeature to work on!

{% gist https://gist.github.com/Jamie-VESoft/a6c50a9c9688415e9c0e62f47f800192 %}

#### Code and Documentation Style

You can implement/fix your feature, comment your code in your myfeature branch now. Please follow the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) style and [Documentation Style Guide](https://github.com/vesoft-inc/nebula/blob/master/docs/manual-CN/4.contributions/developer-documentation-style-guide.md).

We are using the [clang-format](https://clang.llvm.org/docs/ClangFormatStyleOptions.html) to format the code. It is recommended that you configure it according to the IDE/editor you use. See how to configure clang-format with [vim](https://github.com/rhysd/vim-clang-format)/[emacs](https://github.com/llvm-mirror/clang/blob/master/tools/clang-format/clang-format.el)/[vscode](https://code.visualstudio.com/docs/cpp/cpp-ide#_code-formatting).

#### Develop

Edit your code and commit the changes with the following command.

{% gist https://gist.github.com/Jamie-VESoft/8a353aa903cc04da7c3d36e5c6800c77 %}

#### Push Changes to GitHub

When ready to review (or just to establish an offsite backup or your work), push your branch to your fork on github.com:

{% gist https://gist.github.com/Jamie-VESoft/76b5ffd576a36b78e962fb14ab942539 %}

#### Create Pull Request

- Visit your fork at https://github.com/$user/nebula (replace $user obviously).
- Click the Compare & pull request button next to your myfeature branch.

#### Ask for a Code Review

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).

### How to Be a Nebula Graph Contributor

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.

#### Example: Get Started

![](https://cdn-images-1.medium.com/max/1024/1*FffDjKnrV6KkFoHx0Q3bHQ.png)<figcaption>Sample — Get Started</figcaption>

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](https://github.com/vesoft-inc/nebula/blob/master/docs/manual-EN/README.md) to see all the **Nebula Graph**  docs.

Last but not least, you are welcome to try **Nebula Graph** at our [GitHub Repository](https://github.com/vesoft-inc/nebula). If you have any problems or suggestions please raise us an issue.


* * *