Creating a pull request to any open source project like Apache AGE
Tags: github, git, beginners
Published: 2023-09-15 16:12:33

I was working on an open source project Apache AGE. I have done so many PR's in my local repo project. But doing a Pull request to an open source project is a bit different from doing it in your local repository. 
For this i assumed that you have github setup on system if no you can follow [this blog](https://dev.to/muhammadzeeshan03/getting-started-with-git-and-github-beginners-guide-mah). So, let's get started. 

## Forking the Repository

It's the very first step you need to do before creating a pull request. Forking a github repo will create a copy of the project that you forked under your account. So, to fork AGE repository you need to go to AGE's source code. Then fork the repo and it will create the copy under your account.

## Clone

Next step is clonning the repository. This step will clone the AGE's source code into your working environment. And to clone the code you can use the command.

```
git clone path_to_the_repo
```

replace the `path_to_the_repo` with the path of your copy of AGE's source code. This will make sure that the code is now available on your computer.

## Branch Creation

Create a new branch. In this branch you will complete your task and will add your task as a branch in AGE repository. To create a branch you can run the command
```
git checkout -b branch_name
```
Replace the branch_name with the name of the branch that you want to set. This command will create a new branch and checkout to that branch as well. If the branch already exists it simply checkout to that and if not it will create a branch with that name and then checkout to that. If you are using `vs code` you can also create a branch by using git/github extension of vscode. 

## Add and commit your task
Now everything is setup. No you need to do your changes that you want to add or remove code in the AGE's repo. Now it's time to complete your task. After completing your task you need to push it to your repository. For that you need to run the following commands.

```
git add. 
git commit -m "Your commit message"
```

These two commands will add your changes to stages and then add the commit message. You can replace the `your commit message` with the message you want to add. Let's say you have changed a data types of some variables you can replace it with changed/updated the data types and so.  

Now after this push the changes to github.
For this use the commad. 
```
git push
```
If it's not working or giving some upstream warning. You can also use this command. 

```
git push --set-upstream origin branch_name
```
This will push all the changes to your copy of code on the github. Now the next and final step is creating a Pull Request to the AGE's source code. 

## Pull request
For this you need to go to your local copy of AGE's code. Click on the `New pull request` button. This will redirect to a page where you have to set the base repository and then its base branch. Make sure these both are the one that you need to create a PR to. After that there will be an option of compare branch. Set that to the branch that you just created. 
Then add title and description of the PR. These could be something that explains what you have done in your code and what problem you solved. After adding these click on create pull request.

## Note
 To get you work merged you need to follow the community guidlines to create a pull request. For that you can check this [https://github.com/apache/age](https://github.com/apache/age).


## References

[https://age.apache.org/](https://age.apache.org/)
[https://dev.to/rrrokhtar/guide-for-creating-pull-requests-on-apache-age-1nkm](https://dev.to/rrrokhtar/guide-for-creating-pull-requests-on-apache-age-1nkm)