Skip to content

Instantly share code, notes, and snippets.

@rsp
Last active February 26, 2024 10:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsp/8e565895df24c46ee80cfaac68d05e64 to your computer and use it in GitHub Desktop.
Save rsp/8e565895df24c46ee80cfaac68d05e64 to your computer and use it in GitHub Desktop.
How to create a Pull Request on GitHub

How to create a Pull Request on GitHub

1. Fork the repository:

Fork the repo

2. Select user or organization to fork as:

(if you belong to one or more organizations with appropriate permissions)

Select user

3. Clone your fork locally:

a. Using GitHub Desktop:

(see GitHub Desktop website)

Open in GitHub Desktop

b. Using the command line:

Copy the repo URL:

Copy the repo URL

Clone it with the git command:

git clone git@github.com:YOUR_USERNAME/warsawjs-workshop-22-unit-converter.git

4. Create a new branch:

Enter the directory:

cd warsawjs-workshop-22-unit-converter

Create and checkout a new branch for a new feature:

git checkout -b feature/your-new-feature

or for a bug fix:

git checkout -b fix/some-bug

(Those branch names like feature/your-new-feature or fix/some-bug are just conventions but technically you can call them however you want.)

5. Make your changes:

Now edit some files.

(You can make the changes before you create a new branch.)

6. Add your new changes:

Add the changed files with the git command:

git add frontend/index.html

7. Create a commit:

Commit the added files to your branch:

git commit -m 'Your commit description'

8. Push changes to your fork:

Push the new commits on your branch to your fork:

git push origin feature/your-new-feature

9. Enter pull requests:

Now go to your fork on GitHub or to the original repo Pull Requests:

Pull requests

10. New pull request:

Create a new pull request:

New pull request

You will go a "Comparing changes" page.

11. Comparing changes:

Comparing changes

A - this should be the original repo

In this example: rsp/warsawjs-workshop-22-unit-converter

B - this should be the main branch of the original repo

In this example: "master". Usually called: "master" or "develop".

C - this should be your fork

In this example: YOUR_USERNAME/warsawjs-workshop-22-unit-converter

D - this is your branch with the changes

In this example: feature/your-new-feature

12. Create pull request:

Create pull request

Click "Create pull request", add a title, description and you're done!

THE END


Comments?

Still any doubts? Please comment below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment