# How to Create a Pull Request on GitHub

**Step 1 - Fork the Repository**

The first thing you need to do is fork the repository you want to contribute to. This creates a copy of the repository in your own GitHub account. To fork a repo, simply click the "Fork" button in the top right corner of the repository's GitHub page.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695256663541/63d44eb2-b871-4b12-8992-90dd7d810ac1.png align="center")

**Step 2 - Clone Your Fork**

Next, you need to clone your forked repository to your local machine. Go to your forked repo on GitHub, click the green "Code" button, and copy the clone URL. Then run the following git command in your terminal to clone your fork:

```bash
git clone https://github.com/YOUR-USERNAME/REPOSITORY-NAME.git
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695256764826/9edef99c-af86-4a92-a816-fc115b7b0406.png align="center")

**Step 3 - Make Your Changes**

Create a new branch for your changes:

```bash
git checkout -b my-new-feature
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695256944608/fe2e99d0-3c8c-4a7f-bda6-aadac1e37b2e.png align="center")

Now you can make changes to files in your local clone of the repository. Use your favorite text editor or IDE to make changes.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695256863959/b88271b6-f217-48df-a558-02fe69a5cbb5.png align="center")

**Step 4 - Commit Your Changes**

Once you've made your changes, commit them with descriptive commit messages:

```bash
git add .
git commit -m "Add new feature X"
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695257044216/17fa11ca-24d4-4052-9fd8-707d804311e3.png align="center")

**Step 5 - Push to GitHub**

Push your changes to your fork on GitHub:

```bash
git push origin my-new-feature
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695257086883/204fcc8f-5ece-4bf9-be5f-3b3e38856f82.png align="center")

**Step 6 - Submit a Pull Request**

On GitHub, navigate to your fork of the repository. You should see a banner indicating your recently pushed branch with a button to "Compare & pull request". Click that button.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695257124817/671a9255-f345-432b-940a-9eaad563db4d.png align="center")

On the next page, give your pull request a title and description explaining your changes. Click "Create pull request".

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695257146805/5996e2d0-f80e-4242-a251-4e923672f24a.png align="center")

**Step 7 - Discuss and Update**

A project maintainer will review your pull request and may request changes. Have a discussion in the comments, and push follow-up commits to your branch to update your pull request.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695257223585/3529b4ce-4586-4ff5-884f-6a2d25c004bd.png align="center")

**Step 8 - Merge**

Once your pull request has been approved, it will be merged into the original repository! Congratulations on your open-source contribution!

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695257251089/b1763d17-8062-4e6b-9870-5f66ed0a32b0.png align="center")

Conclusion: Pull requests are an essential tool for contributing to projects on GitHub. By forking, cloning, making changes, and submitting a PR, you can easily collaborate on open-source software. Make sure your code is well-tested before submitting a PR, and be ready to have a constructive discussion about your changes. Happy coding!
