I'm trying to add a submodule to an existing project. I followed the instructions at How to set up a git project to use an external repo submodule?, but the directory structure is wrong. I am aiming for a "it just works" so users are not hassled.
The initial clone and submodule process:
git clone https://github.com/weidai11/cryptopp.git
cd cryptopp
git submodule add https://github.com/noloader/cryptopp-autotools.git
git submodule update --remote
The submodule only has one file at the moment, and its a README.md
:
$ find . -name README.md
./cryptopp-autotools/README.md
What I need to accomplish is, add the submodule's files to PWD
and not the subdirectory cryptopp-autotools
.
How do I setup the submodule such that the submodule's files are in PWD
and not subdirectories?
The Git Submodules man page seems to indicate we can specify a <path>
, but here's the result of trying to do so:
git clone https://github.com/weidai11/cryptopp.git
cd cryptopp
git submodule add https://github.com/noloader/cryptopp-autotools.git $PWD
git submodule update --remote
'/home/jwalton/cryptopp' already exists in the index