I'm editing a document with a coworker, who has sent me a pull request. My coworker has edited many lines in the document. Some of the changes I'd like to accept, but others I want to leave out. Is there a way to do this with git (specifically with GitHub)?
-
When you say "pull request" are you actually referring to a specific Git hosting service (e.g. GitHub)? – Oliver Charlesworth Nov 12 '17 at 19:14
-
Hi @OliverCharlesworth yes, I am talking about GitHub. I'll add that tag. Thank you. – StatsSorceress Nov 12 '17 at 19:14
-
[`git cherry-pick`](https://git-scm.com/docs/git-cherry-pick) from CLI – Remus Rusanu Nov 12 '17 at 19:36
2 Answers
The recommended flow is that you provide feedback by the way of comments during the review to your coworker so that they make changes and request the merge again. The positive side to this is that you share the view with them and agree on this going forward.
GitHub provides means to do this you can read more about this here: https://help.github.com/articles/about-pull-request-reviews/
Alternatively, if you really want to make the changes yourself on top of their changes without asking them to do these changes you can push a commit with your changes to their branch and afterwards accept the merge request.
But they should have not opted to prevent other users to make modifications to their branch. Read more details on this answer:
Adding commits to another person's pull request on GitHub

- 1,930
- 1
- 21
- 31
As far as I am aware the GitHub web UI does not provide that but using git you could do this in many ways. See the GitHub guide here how to merge a modified version of a PR.

- 949
- 2
- 10
- 16