mkdir topdir
mkdir another-git-directory
touch fileC
touch fileD
git add .
git commit -m \"sub-dir in
A nested repo is by default untracked.
(actually it tracks the submodule root folder as a gitlink, special entry in the index)
Git will detect the nested .git
repo, and the parent repo will delegate any file status to the nested one.
To show them tracked, you may have to:
git rm --cached mysubmodule
.mysubmodule
represents the gitlink, while mysubmodule/
is the folder created by the checked out submodule.git add mysubmodule
(here, you can add or not a trailing slash, it does not matter)mysubmodule
.