Pushing a series to a branch #1470
Replies: 4 comments 1 reply
-
In most cases, I use Normally, I use I'm not sure if I understand your workflow fully; do you intend to cherry-pick the commits every time you want to re-push, or just for the initial push? If every time, you may find a tool like You may also find the Jujutsu "mega-merge" workflow useful, since then you can keep your individual branches separate to begin with, but also have their contents merged in the working copy for development. Unfortunately, in git-branchless, there's currently no way to programmatically cherry-pick the range and address the resulting commits:
There might be a workaround in your case where you run something like $ git test run -s worktree && -x 'git rebase X Y --onto main && git push origin @:some-branch The design for (If you can work out a command that can determine the root or head commit for a range automatically, perhaps using |
Beta Was this translation helpful? Give feedback.
-
Thanks for your thoughtful reply, it's taking me a while to fully process all of it.
Essentially, I clone a remote repository and do some work and create multiple commits. I now have five consecutive commits, but they need to be submitted as four different branches to create four different merge requests. If I had to use git send-email 84db4c..94dec
git send-email 834fda..a938c
... But when it comes to GitHub (and its clones), I need to create a branch for each series, and then cherry-pick individual commits into each one. I'd instead want to do Perhaps I'm asking the wrong question here though: how would you deal with such a situation?
The Are you using Why do you need to specify X would typically be I was unfamiliar with the
This should be just |
Beta Was this translation helpful? Give feedback.
-
The truth is, I don't have a mechanism to assert this, but I also have no doubt that this is true. This is the main reason I've taken a long time to reply: because I both don't have an answer to your question, but know for a fact that this is true. I'll lead with two specific scenarios which I encounter every week: Scenario 1: aportsI contribute to Alpine's aports repository, which contains package recipes for all of Alpine's packages. I work on my Individual changes typically affect only one package, so each commit only touches files inside one directory. So I never have two different MRs which touch the same files. The problem comes around when I need to update one of these changes: they live both in my Scenario 2: zkI have my own fork of the zk project, where my I build from main and use this on my own hosts. Some of the features in main are submitted upstream as PRs: https://github.com/zk-org/zk/pulls/WhyNotHugo Some features are not ready for submission, so only exist in my main branch. Again, I work on my
I understand the basics of sh, my question is about semantics, not syntax.
For example, |
Beta Was this translation helpful? Give feedback.
-
Based on your answer, it seems that I could just use a script which produces a new worktree with the temporary branch, cherry-picks my range, pushes it, and drops the worktree. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
TLDR: I want to push
84db4c..94dec
toorigin
under a new branch namedsomething
.When working on changes locally, I often need to push individual commits (or series of commits) into their own branches, so that I can open a single MR for each of them.
This requires several manual steps:
These steps need to be repeated for each commit/series.
I'm in need of something like
git send-branch origin 84db4c..94dec:something
, which would push that series into branchsomething
. I don't care if the branchsomething
is left over locally or not.I've been reading through the wiki, and it would seem that the mindset with which this project was written is close to my own. But I don't see a way of doing that I'm trying to do.
Is there some way to do this with
git-branchless
? How do you deal with this sort of scenario?Beta Was this translation helpful? Give feedback.
All reactions