Git question: multiple PRs

This is more of a git question, but since I found many possible solutions online I am wondering if there is a preferred way to do this in the Julia package ecosystem.

Consider a git repo for a package, for which I want to submit multiple PRs (bug fixes, new features, etc) simultaneously (in practice, simultaneity happens because merging PRs takes time).

So I create a new branch from master, named pr1, write the code, and submit a pull request. Now for the second PR pr2, should I branch from master or pr1, as in

master -> pr1 -> pr2

? Or branch parallel, eg

master --+--> pr1
         |
         +--> pr2

If I branch from master, but merging takes time and I want to use the fixes myself locally in the meantime, what’s the best way to do it? Should I create a third local branch, and merge pr1 and pr2 into it?

1 Like

I’d usually say to do two separate branches each starting from master, especially if the changes are mostly independent.

A local branch with both changes cherry-picked or merged sounds good for using it locally - you could also have the changes applied as diffs to your local copy without necessarily committing them. Would just need to remember to check back out a proper branch or release when everything gets incorporated upstream.

3 Likes

I always create lots of deploy/pr1_pr2_pr5-like branches for specific functions/fixes I want to use.

2 Likes