💾 Archived View for zigford.org › trying-out-a-pull-request.gmi captured on 2024-02-05 at 09:37:13. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-03-20)

-=-=-=-=-=-=-

about

links

scripts

Sharing linux/windows scripts and tips

Trying out a pull request

October 06, 2019 — Jesse Harris

You've received a pull request on your repo. Before merging you want to see what it looks like in your code base. Perhaps you will run some manual test or some diffs from the command line here and there.

~~~

You can find this information anywhere out there on the web. As always the purpose of this blog is more of a notetaking for me, but the other angle I want to cover is not the exact commands to type (That will be here too), but why you are typing them.

Get setup

You want to start off with a clean local repository. That might mean running a git pull, a git clone or switching to the master branch using git

checkout.

I'm checking out a PR for my snapd ebuild repo

snapd ebuild repo

What information will you need?

You will need to know the GitHub authors account name and the branch that they are making changes from.

The commands

From here it's easy. Conceptually, we are checking out a local branch to pull the changes into

        # localbranchname is a new branch where we will pull
        #   the PR. It can be named whatever
        # master is the branch we want the new branch to be
        #   based off

        git checkout -b <localbranchname> master
        git pull <githubAddressToUsersFork>.git <branchTheyCommitedTo>

Merge to master

Perhaps your happy with the change. Your very close to being able to merge the PR to your master repo. Here is how you would do that.

```

git checkout master

git merge <localbranchname>

git push origin master

```

Tags:

git

github

© Jesse Harris

mailto:jesse@zigford.org

Generated with bashblog, a single bash script to easily create blogs like this one

bashblog