I have a repo A which is a template project which contains a submodule. I want to be able to clone this repository and start a new project using this template project.
This command works, but it gives me a repository initialized with the latest commit of the repo A.
git clone --recursive <url>
I would prefer to clone the repo and then commit with a custom relevant message like "init from template project" as the first commit, and not the lastest submodule commit message.
This answer says I should do (I added --recursive to clone submodules):
git clone --recursive --depth=1 --branch=master git://someserver/somerepo dirformynewrepo
rm -rf !$/.git
After that I tried:
git init
git submodule init
git commit -m "init from template"
git push
Every submodules files are not recognized as beeing a submodule, and commited as normal files. How can I avoid that?