<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>One option is to work on the throw-away combined branch as above, keep your commits for the two topics distinct, then cherry-pick out into the separate topic branches.<br></div><div><br></div><div>If you are committing in the topics and respinning the throw-away branch, I would recommend rerere, so you don't have to repeat conflict resolution.<br></div><div><br></div><div>https://git-scm.com/docs/git-rerere</div><div><br></div><div>On Sat, Apr 17, 2021, at 5:02 PM, Jacob Faibussowitsch wrote:<br></div><blockquote type="cite" id="qt" style="overflow-wrap:break-word;"><div>I have done this maybe only a handful of times (and not with petsc) but take a look at git worktree <a href="https://git-scm.com/docs/git-worktree" class="qt-">https://git-scm.com/docs/git-worktree</a><br></div><div class="qt-"><br></div><div class="qt-">The basics of it is:<br></div><div class="qt-"><br></div><div class="qt-">1. cd $PETSC_DIR — or wherever the root folder of your repo of choice is<br></div><div class="qt-">2. git worktree add ../myBranchName<br></div><div class="qt-"><br></div><div class="qt-">Then this recreates the entire src tree of the current branch in a separate directory (namely $PETSC_DIR/../myBranchName). Not sure how useful it is for petsc, given how dependent everything is on $PETSC_DIR but it's occasionally useful. Its as if you had 2 separate clones of petsc, but they both share the same .git folder (I think).<br></div><div class="qt-"><br></div><div class="qt-"><div class="qt-"><div dir="auto" style="color:rgb(0, 0, 0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;-webkit-text-stroke-width:0px;text-decoration-line:none;text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;overflow-wrap:break-word;" class="qt-"><div dir="auto" style="color:rgb(0, 0, 0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;-webkit-text-stroke-width:0px;text-decoration-line:none;text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;overflow-wrap:break-word;" class="qt-"><div><div>Best regards,<br></div><div><br></div><div>Jacob Faibussowitsch<br></div><div>(Jacob Fai - booss - oh - vitch)<br></div></div></div></div></div><div><div><br></div><blockquote type="cite" class="qt-"><div class="qt-">On Apr 17, 2021, at 17:24, Barry Smith <<a href="mailto:bsmith@petsc.dev" class="qt-">bsmith@petsc.dev</a>> wrote:<br></div><div><br></div><div class="qt-"><div class="qt-"><div><br></div><div> Say I have a project (a code whose source is not in the PETSc repository) that requires code from two PETSc branches (that may or may not yet be MR) but I do not want to make a single PETSc branch (since it would be incoherent). I may possibly be needing to add code to both of the PETSc branches as I develop the project. I also need to do development sometimes on different machines.<br></div><div><br></div><div> I can do <br></div><div><br></div><div> git checkout branch1<br></div><div> git checkout -b combinedbranch<br></div><div> git merge branch2 <br></div><div> configure<br></div><div> make<br></div><div> use for a while<br></div><div><br></div><div>but now I need to fix or add something to branch1 (which, of course, will be an iterative process as I write the code and fix it) and then add something in branch2. <br></div><div><br></div><div>Doing the above procedure over and over again is tedious and prone to produce errors, editing in the wrong branch etc.<br></div><div><br></div><div>Does anyone have advice on good work flows for this situation?<br></div><div><br></div><div>Barry<br></div></div></div></blockquote></div></div></blockquote></body></html>