<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">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="">https://git-scm.com/docs/git-worktree</a><div class=""><br class=""></div><div class="">The basics of it is:</div><div class=""><br class=""></div><div class="">1. cd $PETSC_DIR — or wherever the root folder of your repo of choice is</div><div class="">2. git worktree add ../myBranchName</div><div class=""><br class=""></div><div class="">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).</div><div class=""><br class=""></div><div class=""><div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); 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: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div>Best regards,<br class=""><br class="">Jacob Faibussowitsch<br class="">(Jacob Fai - booss - oh - vitch)<br class=""></div></div></div>
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On Apr 17, 2021, at 17:24, Barry Smith <<a href="mailto:bsmith@petsc.dev" class="">bsmith@petsc.dev</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><br class=""> 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 class=""><br class=""> I can do <br class=""><br class=""> git checkout branch1<br class=""> git checkout -b combinedbranch<br class=""> git merge branch2 <br class=""> configure<br class=""> make<br class=""> use for a while<br class=""><br class="">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 class=""><br class="">Doing the above procedure over and over again is tedious and prone to produce errors, editing in the wrong branch etc.<br class=""><br class="">Does anyone have advice on good work flows for this situation?<br class=""><br class="">Barry<br class=""><br class=""></div></div></blockquote></div><br class=""></div></body></html>