Can I continue the pull request opened by someone else on Github?

In a repository that is not mine, a third person opened a transfer request. One of the owners proposed some changes before being able to combine them. However, the author of the request for stretching did not do this, and he remains open for several months without any changes.

Actually, I mean a situation like that .

I would make myslef the requested improvements.

What is the cleanest and best way to do this? Can I add my commits to the following or do I need to open a new transfer request?

+5
source share
2 answers

The only way to update the transfer request is to click on the branch that was PRed - so even the original repo owner cannot change the PR by default. It makes sense - for traceability, at least.

So, if you want to finish this work, the best thing you can do is to unlock the source repo, clone on your computer, add the PR repo as remote , checkout PR'ed branch, commit Also push those changes in your own fork and make a new PR, contained in the comments, which he continues and fixes another PR, so the original PR closes when your merges.

In this case, something like:

 $ # Go to https://github.com/cheeriojs/cheerio/ and fork it $ git clone https://github.com/Delgan/cheerio/ && cd cheerio # assuming that your GH username :) $ git remote add pr-base https://github.com/digihaven/cheerio/ $ git fetch pr-base $ git checkout pr-base/master -b 641-appendTo_prependTo $ # work work work $ git add #... $ git commit -m 'Fixed all the things! See #641, fixes #726' $ git push origin 641-appendTo_prependTo $ # Go to your repo and make the PR $ # ... $ # SUCESS! (??!) 
+7
source

From your branch use this command

 git pull origin <the open pull request branch name> 

It pulls the commits from this branch into your branch.

Make improvements and click on the main branch.

+2
source

Source: https://habr.com/ru/post/1236734/


All Articles