Saifur Rahman Mohsin
Saifur Rahman Mohsin

Reputation: 1011

How to create a new PR when one already exists?

I had cloned a repository a few months ago: https://github.com/SaifurRahmanMohsin/october

It's parent repository is https://github.com/octobercms/october

The devs of the parent repo accept PRs only on their develop branch. So I made a PR to their develop branch: https://github.com/octobercms/october/pull/4377

It needs time for reviews and possibly revisions in order to be merged so that is going to take a while.

Now I want to create a new PR which is unrelated to the code of this PR. However, I should ideally be making the PR starting from the HEAD of their develop branch: correct?

I have not yet deleted my fork so the github parent-child link exists: so I could make a commit into my fork's develop branch and it would show up in the PR that I had made (4377).

I want to do 2 things:

  1. Create a new PR (call it PR 5000) that's completely unrelated to this code and be able to add more code if needed (if they want revisions).

  2. I want to create a future PR (say PR 5500) that's related to the old PR (PR 4377) i.e. I want to write some abstraction classes and then make a new commit in PR 4377 so that it incorporates using those new abstract classes.

How would I go about doing these considering that I already have an unclosed PR?

Upvotes: 0

Views: 2607

Answers (1)

Philippe
Philippe

Reputation: 31187

When you are working with PR, the good practice is to create a new branch each time you want to create a PR.

Side note: That's what you should have done with your previous PR targeted to be merged in the develop branch. And not commit in your own develop branch.

You could create each new branch wherever you want.

Now I want to create a new PR which is unrelated to the code of this PR. However, I should ideally be making the PR starting from the HEAD of their develop branch: correct?

It's indeed a good practice that each branch that will end in a PR to start in the last commit of the branch you want to merge into.

I want to create a future PR (say PR 5500) that's related to the old PR (PR 4377)

But as you easily understand, if you need to create your branch at the tip of another branch, that's OK (but it's better to tell in your PR that it is dependent of another one to be merged after)

I have not yet deleted my fork

Don't do it until all your PRs are merged!!! And don't want to contribute to this project anymore...

Upvotes: 1

Related Questions