I have a project that should work under Windows and Linux. I put a central repository as folder on a server in our company. Next to it lies a repository which is a submodule of that repository.
Now I can access this folder under Windows with something like \\server\project
. Under Linux the folder name is /mnt/server/project
. The both the project repo and the submodule repo are put into different subdirectory of that folder. This is giving me problems when I want to update my project on Linux after I add the submodule on Windows and push. Is there a way to change the submodule url in .gitmodules locally without committing these changes back to the central repository?
It would also be ok to set the urls in the .gitmodules file depending on the platform I'm on. Maybe there are even other alternatives.
You can always edit the url in .gitmodules
, followed with git submodule sync
. The change in .gitmodules
will show in git status
, but maybe you can live with that.
The best would be to find a way to give url that both Linux and Windows would understand, like not using a mount point. Can't you use IP directly? Something like 192.168.0.42/project/submodule.git
? (replace with your server's IP of course. Or if you have a host name it would obviously be better).