A recent change in Git changed the way the .git directory is handled when using submodules.
Instead of having one .git per submodule, everything is now in the "root level" .git directory (the one corresponding to the working copy including the submodules).
Then, in each submodule, a file is created which points to the new location of the .git directory.
In my project, I have the following .gitmodules file:
[submodule "tests/shared-tests"]
        path = tests/shared-tests
        url = git://github.com/roboptim/roboptim-shared-tests.git
[submodule "cmake"]
        path = cmake
        url = git://github.com/jrl-umi3218/jrl-cmakemodules.git
When I do git clone --recursive, I then obtain:
$ cat cmake/.git
gitdir: /home/moulard/profiles/default-x86_64-linux-ubuntu-12.04.1/src/unstable/roboptim/roboptim-core/.git/modules/cmake
I am currently using Git 1.8.1.5.
My questions are:
- Why did this behavior change? I don't see any obvious gain to this new strategy.
- How can I then move safely a working copy? (if I move my working copy, I get an error message telling me that the path to the broken gitdir is not a Git repository anymore)
Please note that this is not the same as the previous question Moving the parent directory of a git repository that contains submodules in the sense that I am sure this is not an issue related by the presence of an absolute path in my .gitmodules file.
 
     
     
    