Making a PR for an existing commit

A few days ago, I pushed a commit to my own 5.2 branch, which fixes a CSV import problem which was triggered by code in another PR, that was not fully tested. And becuase this commit sits on top of a few other commits, that I made for my own use, I see no easy way to make a PR for just that. What I mean is, that on GitHub, I can only create a PR that includes all 4 commits that I made since the last sync.

Is there a way around this? Does this mean that I must copy or move this commit to a feature branch? And if so, how can I do that on GitHub?

Create a new branch and then cherry pick the commit into it. Then create a PR from this new branch.

Cherry-pick is great for such situations however it’s not available from GitHub’s web interface as far as I can see. It is available from GitHub Desktop if you want to use that. Of course, git can do it as well.

To avoid this sort of situation, my practice is to create a new branch for every different task I work on, even if the intent is simply to merge it back into my own master branch.

And where should I put that branch?

Push it to your GitHub fork and then create a pull request.

I knew that, but what I wanted to know was where I should have attached that new branch, i.e. where in the maintenance branch, to which commit.

This time, I took the easy way out, by resetting my local branch to the upstream gramps52, and then applying this single commit, forgetting the others.