3

I have projects folder that is in my /home/my/ folder on host and mounted at /home/user/projects at docker container. In this folder there is git repo /home/user/projects/repo with additional worktree: /home/user/projects/repo-b (added by git worktree add)

When I am tring to do any git command in /home/user/projects/repo-b I recive

fatal: Not a git repository: /home/my/projects/repo/.git/worktrees/repo-b/

I have tried to create link at home: me -> user without any progress.

4

2 回答 2

1

Referencing a directory which is not mounted inside a container is a big challenge (so do symbolic links). Whenever possible, avoid this kind of usage so that it won't cause confusion.

If you are going to use it anyway, try to mount both of the directories.

于 2018-03-05T14:17:31.130 回答
0

Ok, problem was simple and stupid. My git in docker container was old enough not to support worktree functionality. So updating git and creating simlink to user folder solve it.

于 2018-03-06T05:29:34.997 回答