Skip to content

Latest commit

 

History

History
61 lines (43 loc) · 1.92 KB

6-CREATE_GITHUB_PR.md

File metadata and controls

61 lines (43 loc) · 1.92 KB

Creating a Pull Request through Github

A Pull Request for github is a request to merge one branch to another. Typically this is some development branch to the main branch. Go to Github and you will see

Add SSH Key

Which is handy as it'll do a lot of the work for you, but let's go through the route where GitHub doesn't give this convenient button. Click Pull request up top

Add SSH Key

Click Add SSH Key

And then choose the branch you want to merge

Add SSH Key

Review the changes,

Add SSH Key

And then simply click Add SSH Key at the top right. Now you will have an "Open pull request" page

Add SSH Key

Now click Add SSH Key and you now have the PR created!

Click Add SSH Key to merge your branch into main.

Now we can view this PR in our local branch

Viewing PR in local

$ git checkout main # because we were on our own branch
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
$ git pull
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (1/1), 618 bytes | 309.00 KiB/s, done.
From github.com:mitchdz/myrepo
   78cad5f..0b740e9  main       -> origin/main
Updating 78cad5f..0b740e9
Fast-forward
 b.txt | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 b.txt

We can view the last commit in our local branch with

$ git log -1
commit 0b740e938146026a75a8a6153980910222e26ad6 (HEAD -> main, origin/main)
Merge: 78cad5f af91a8b
Author: Mitchell <[email protected]>
Date:   Mon Feb 13 12:10:38 2023 -0700

    Merge pull request #1 from mitchdz/mybranch

    b: init commit