February 7, 2022

Dealing with Github Pull requests

This page is about how to deal with pull requests from the receiving end. I have another page that deals with generating a pull request:

For some time I have had a number of projects on Github, and sure enough, one day I got a pull request. This means that somebody forked my repository, made changes, and are now offering them back to me. This is a nice thing! It is all new to me though.

It turns out that this can all be handled on Github, if you are trusting, you can just say, "OK, cool, merge those changes". A judgment call in any case.

The quick and trusting way (2022)

I let github show me a "diff" like display which makes it pretty quick and easy to see the proposed changes. Then I click the button on the github page to merge the changes. The on my local machine I do:
git pull origin master
No extra branches were created (at least in this case)

The careful way (2018)

In another case, I decided that although the github button was the easy path, we were going to take a careful look at the proposed changes first. On github, there is a link for pull requests, and in that page there are instructions (or you can bring up instructions) to do this remotely via the command line, so I did this:
git checkout -b quietboil-master master
git pull https://github.com/quietboil/esp8266.git master
This gives me the proposed changes in a new branch on my home machine. All the changes are in one file, so I do this:
git checkout master
cp boot.txt /home/tom
git checkout quietboil-master master
diff boot.txt /home/tom/boot.txt
After looking this over, I am satisfied, and click the button on Github to do the merge. Then I do:
git checkout master
git branch -D quietboil-master

Links


Feedback? Questions? Drop me a line!

Tom's Computer Info / [email protected]