简体   繁体   中英

Pushing to Pull Request Branch on GitHub

I've got a project where somebody has submitted a pull request. I locally made some commits to that pull request, and even succeed in pushing them to the pull request branch on GitHub. You can see that pr/1 is well ahead of the initial pull request.

https://github.com/uwdub/web-dub-importer-dblp/network

But the code that would be merged by the request is still back at the original pull. My commits are not being added as part of it.

https://github.com/uwdub/web-dub-importer-dblp/pull/1

What am I doing wrong?

As already mentioned by @JBNizet,

The pull request in question is in repo from tonyinsect:master into uwdub:master , while you have made changes to branch uwdub:pr/1 (ie your own repo).

You can either push the changes to tonyinsect:master (if you've the permission), or ask the other guy to fetch new branches from your repo, and merge in your changes in his branch. He needs to do the following

git remote add upstream https://github.com/uwdub/web-dub-importer-dblp.git
git fetch upstream
git checkout master && git merge upstream/master
git push origin master

Once he does these steps, his pull request will automatically be updated.

Worst case, you can do away with his pull request and pull in changes directly from his repo, as below:

git remote add downstream https://github.com/tonyinsect/web-dub-importer-dblp.git
git fetch downstream
git checkout pr/1 && git merge downstream/master
#Check if everything is allright
git checkout master && git merge pr/1
git push origin master

PS: I would suggest avoiding usage of / in naming of branches, it might lead to issues like here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM