Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing a Github pull request

As a newbie to Github, I've just submitted a pull request. The owner of the project is pretty happy with my additions but they're not quite perfect and need a bit of changing.

How do I proceed from here? Do I need to close the current pull request and submit a new one? Or is there a way of amending one?

Also is it preferable to reset my branch and make the required changes from scratch, or make another commit to my branch to amend the changes on top of my previous changes?

like image 201
Lars Avatar asked Jun 13 '13 09:06

Lars


People also ask

Can you redo a pull request?

You can revert a pull request after it's been merged to the upstream branch.

Can I update someone else's pull request?

You cannot add commits directly to User B's pull-request unless you have write access to User B's fork. You can, however, make local additions to the pull-request, by just fetching the pull-request branch into your own local repo (assuming the url for B's fork is public).


1 Answers

Once you create a pull request, if you look near the bottom of the issue it creates, there is a message which mentions that if you push more commits to the branch you've made the request on, they'll be appended to the pull request.

All additional commits pushed to the same branch become part of that pull request. The reason for that is due to the way a pull request works. You can think of it as the person accepting the pull request as pulling the current state of that branch at the moment they decide to merge, rather than creating a set of changes and asking for that to be accepted.

like image 88
j883376 Avatar answered Sep 28 '22 08:09

j883376