I’m working with a branch that I need to split up in two branches: Commits touching files in a specified list of directories go on one branch, the remaining commits go on the other branch.
Now, my idea was to use interactive rebase for that.
To get the first branch, I’d do this:
git log --format="pick %h %s" --reverse -- <dir-list>
and paste the result of that into the editor opened for the interactive rebase.
But then, to get the second branch, I’d have to maintain the opposite for all the other directories in my repo.
Is there a way to get the list of “opposite commits” somehow, or is there another, easier, solution to my problem?
could be written
That is, using
to get the list of ‘raw’ revision ids. Now to get the complementary set of revision ids, I suggest something like
Integrating it all
the complementary set would become
note both
--no-walkparameters there, they are crucialRecommendations
--tag-name-filter catoption