gitopengrok

How to quickly refresh several workdirs related to one git-repo


I have a project, that is stored as a git-repo. The repo has several branches. Also I use OpenGrok (source browser) for the project. To be able to show all branches I cloned the project several times, after that did 'checkout' the required branch.

To update each workdir I do 'git fetch && git merge' for each workdir.

The Q: Is there a way to have one "main" clone, where need to do git fetch. After that each workdir will be updated from the "main" clone.


Solution

  • Exactly that Problem ist addressed by the git worktree commands: one repo but several working trees. Lookup the manual for that command!