Home > Blockchain >  Git equivalent of multiple Perforce work areas
Git equivalent of multiple Perforce work areas

Time:07-19

I've used Perforce for about 10 years, and now having to switch to Git for a new job.

Say I have a recent test regression. The way I would go about debugging it in P4 is create two work areas: one sync'ed to an older CL (with passing test), and one to ToT (top of tree) and then I could add some extra logging code to both and compare the logs from the two runs, or even compare the code directories to see what's changed.

Given that in Git switching branches happens on top of the same physical files on my computer, I am unable to have the two codes side by side.

I there a best practice for doing what I need here? Should I "git clone" the same repo to another directory on my computer and sync it to an older commit?

CodePudding user response:

  1. Yes, you can have as many clones of single repo, as you want
  2. From my POV also, for up-to-date Git using worktrees is more efficient and brain-powered way, as @jthill noted
  3. git bisect is anyway best and real Git-style way of debug history of repo
  • Related