Have just created a new repository with two submodules. It works fine on local but when pushing to the production the submodules are not there. Each submodule root directory is present, but no files inside
git version 2.27.0
Create repo on production
git --bare init
cd hooks && touch post-receive && chmod +x post-receive
cat hooks/post-receive
#/bin/sh
git --work-tree=/var/www/repo --git-dir=/var/git_repos/repo.git checkout -f
Pushing to production from dev/local
git push production master
git status
tells that everything is up to date. Even if it is called in the submodule folder. Have tried to delete the submodule folder on the local repository, commit/push to repository. Then git push production master
and the root submodule folder was deleted on the production server. Then trying to add it again
# git submodule add git@github.com:alias/repo_name.git php/repo/repo_name
Cloning into '/var/www/project/php/repo/repo_name'...
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (19/19), done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 19 (delta 8), reused 19 (delta 8), pack-reused 0
Receiving objects: 100% (19/19), 8.62 KiB | 8.62 MiB/s, done.
Resolving deltas: 100% (8/8), done.
Then commiting to repository and then git push production master
. The same problem. In production the root folders of the submodules are present but no files in the directories.
When I browse the repository on github, the submodules are correctly linked.
Everything works in the local repository