0

I created a pull request (PR) for a git repository I forked on github. I made the mistake of making the changes and creating the PR from the master branch (the repo is still using the old naming convention, I know the new convention is to call it main).

I waited a bit to see if the owner would merge the PR, but instead he is taking much more time than I hoped (several months). Therefore, I am now tempted to move those changes to a purposely created branch of my repo, and to change the PR in github to use that new branch. However, I do not want to create a new PR (since there has been some discussion already and I don't want to duplicate that), nor I want to lose the history of my changes.

Is there an easy and foolproof way to do that? "No" would be a fair and potentially accepted answer, if that's the case: consider the "requirements" I am placing in the next paragraph.

Requirements:

  • I know that's two questions in one (change things in my repo and change things in github), but I need them both or neither.
  • I don't want to create (or risk creating) more problems than this operation is going to solve
  • I don't want to spend more time performing the operation than I am going to save by having my master branch freed
Davide
  • 17,098
  • 11
  • 52
  • 68

1 Answers1

1

You cannot change the "source branch" in a GitHub PR, but you could change the "target branch". If you want a PR for a different source branch, you have to create a new PR.

You are not losing any of the discussion; simply create a new PR and link to the initial PR saying "This PR supersedes #soandso and uses a different source branch. Find previous discussion of the code in PR #soandso"

Another thing that comes to mind: you could rename your fork on GitHub and then create a new fork to use until your PR has merged. Then delete the old fork.

knittl
  • 246,190
  • 53
  • 318
  • 364