Begin your opensource journey
Tags: github, opensource
Published: 2022-06-29 08:40:34


 This blog post is all about contributing to open source projects to get-up, by making opensource contribution anyone can enhance their developer profile and can make connections with new people around the world who have a similar interest.
<br>
#### So, let's start opensource
<br>

* There are certain prerequisites to make a contribution to open source projects on github. 

##### (1) You must have git installed in your system. if you don't have git preinstalled, then check out this link,
 [git installation](https://www.atlassian.com/git/tutorials/install-git)
##### (2) You must have a github account to find projects and contribute on github project

That is it, your good to go.
### Step - 1
#### Fork the repository
* find any github project/repository in which you want to contribute.
Fork any gituhb repository by clicking on `Fork` opetion at top-right corner of webpage. This'll automatically create a copy of that project in your github account.
![Fork-githu-repo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c79i06mmkup9sv9f4cy4.png) 

### Step - 2
#### Clone the repository to your machine.
* Open cloned repository in your github accout which is shown in your repositories tab.
* Now, click on code button(Green in color) and copty the url of that repository
  
|                |                |
| -------------- | -------------- |
| ![code option](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/955999oq7ksqmc8b9ap9.png) | ![copy url](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s2ajgovq4upqv55t72n4.png) |

* After coping url of repository, open any directory in terminal folder where you want to clone(make copy localy) this project and and run command.

``` bash
// Git Command to clone repo
git clone <repo_url>

// For instance
git clone https://github.com/bhavinvirani/bulletproof-react.git
```

### Step - 3
#### Make your new branch
* Now, open cloned repository in terminal or any code editor and make own branch. and make new git branch.

```bash
git checkout -b <new_branch_name>

// Example 
git branch -b improve_view
```
* Branching is used in version control to maintain stability while isolated changes are made to code and prevent from any code conflicts with production branch (Main branch).
* The name of the branch and the purpose should be reasonable and detailed. To easy to understand.
* here, -b option automatically moves you to newly created Barch '

### Step - 4
#### Do changes and commit those changes
if you don't to how to commit, then check out my this blog
[Getting Started with 'Git'](https://dev.to/bhavinvirani/getting-started-with-git-1jlj)

### Step - 5
#### Push branch on github
Now, Push your changes of new branch on github. While being on your newly created branch from terminal
```bash
git push origin -u <your_branch_name>

Example 
git push origin -u improve_view
```
* This will create new branch on your forked github repository as well.

### Step - 5
#### Make pull request
 After successfully pushing your branch on your github repository you'll find out `Compare & pull request` option on top of your repository's code section
![compare and pull](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dh08r3d6n8m7b9gwq4vf.png)

* Then you'll be redirected to pull request page and provide required information to the maintainer of that project and give the appropriate pull request title. 
* finally submit your pull request by clicking on create pull request button.

![make pull request](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dr4zvlcfbld98qena23p.png)
 
* As soon as project owner/maintainer merge your changes into the master branch of that project. You will be notify regarding the changes have been merged
 
### For more knowledge checkout my `Github 👁`
{% github bhavinvirani/bhavinvirani%}