Reputation: 75474
How can I create a directory link that will survive git submodule update
?
Given the following example directory structure:
proj
|-- lib3
| `-- submod
| `-- lib
`-- lib
I created a soft link from proj/lib/
to proj/lib3/submod/lib
using something like the following command:
brad@bradpc:~/proj/lib$ ln -s ../lib3/submod/lib submodlib
creating the following directory structure:
proj
|-- lib3
| `-- submod
| `-- lib
`-- lib
`-- submodlib
However, running git submodule update
destroys my link. I was under the impression that a soft link is a logical link to a relative path, so removing the object and re-adding it would keep the link intact. How can I achieve the desired effect?
Upvotes: 3
Views: 1919
Reputation: 514
A soft link made with ln -s should behave like you intended. As I understand it, if you do a git submodule update some part of your directory proj/lib3/submod/lib gets deleteted and recreated. That means there's no difference in that, than manually do a rm proj/lib3/submod and after that a mkdir -p proj/lib3/submod/lib for example.
I tested this manually (rm and mkdir) on my openSuse Linux installation and the soft link was still fine after recreating the directory structure.
In which OS enviroment do you work? Perhaps it's not a true softlink.
Upvotes: 1