I recently started using git worktree and it is awesome. However, I am not sure how to make it work with Docker. Here is my flow:
repo-ahas a dockerFile to build a local container.I create a new worktree like
git worktree add branch-athis will create a folder namedbranch-awith branchbranch-a.I received a PR to review and I need to switch to
branch-b. So I go back to my--bare clonerepo and I dogit worktree add branch-b. and cd into that folder.My docker container doesn't catch new files because it is still linked to files on
branch-aand if I dodocker-compose up -donbranch-b, it throws an error saying thatThe container name "/<name here>" is already in use by container "31344e3448df72e032c42a96d078ea57c11a75023d197e9ab0683e7c773f54e4"
How can I make my docker container to listen to changes on a different folder?
Thanks