I'm really trying to learn how to use git, including the git subodule subcommands. I have already set up a server on which I can host, push and pull git repositories using ssh. I created the main git repository "Travail" on this server, in which I would like to put all my projects as submodules.
In my Travail repository, I already added my project as a submodule in tools/libft : I can develop this submodule, click and pull it out.
But when I try to add another submodule (named fdf, from fdf.git on my server), I get the following problem:
git submodule add ssh:
The git directory for 'projets / fdf' is locally with the remote (s): origin ssh: // git @ XXX.XXX.XXX.XXX: XXXXX / opt / git / fdf.git If you want to reuse this local git directory instead of re-cloning from SSH: //XXX.XXX.XXX.XXX: XXXXX / opt / git / fdf.git use the '--force' option. If the local git directory is not the correct repo or you do not know what it means, select a different name with the "--name" parameter.
Actually there is no subdirectory in projets/
I read in another thread that I should use the git submodule synchronization or edit the .gitmodules file in which the URL in the source submodule repository could be changed.
But my .gitmodules file contains only information about my first submodule (tools / libft), and not about / fdf files:
[submodule "tools/libft"] path = tools/libft url = ssh://git@XXX.XXX.XXX.XXX:XXXXX/opt/git/libft.git
As a French student, I might have missed something in the English documentation, but I was looking, and I really don't understand why I am getting this problem.
I would be glad if I got a solution, but only an explanation would be useful.
git git-submodules
vmonteco Jan 05 '14 at 2:32
source share