I have two very similar repositories with the same submodule. Directories structure:
vss
vss/rcv-nginx
rgw
rgw/rcv-nginx
When request status from the rgw
directory (only it!), it shows that all files are deleted. This does not happen for other similar projects.
Here come the git status commands:
# On vss
peter@peterpc:~/git/vss$ git --git-dir=rcv-nginx/.git status
On branch dev
Your branch is up-to-date with 'origin/dev'.
nothing to commit, working directory clean
# On vss/rcv-nginx
peter@peterpc:~/git/vss$ cd rcv-nginx/
peter@peterpc:~/git/vss/rcv-nginx$ git status
On branch dev
Your branch is up-to-date with 'origin/dev'.
nothing to commit, working directory clean
# On rgw:
peter@peterpc:~/git/rgw$ git --git-dir=rcv-nginx/.git status
On branch feature-rcv-11870_openresty-nginx
Your branch is up-to-date with 'origin/feature-rcv-11870_openresty-nginx'.
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: .gitlab/merge_request_templates/Bug.md
modified: .gitlab/merge_request_templates/Feature.md
deleted: .idea/runConfigurations/Render_Dyrka_Configs.xml
...
(all files marked as missing)
# on rgw/rcv-nginx
peter@peterpc:~/git/rgw$ cd rcv-nginx/
peter@peterpc:~/git/rgw/rcv-nginx$ git status
On branch feature-rcv-11870_openresty-nginx
Your branch is up-to-date with 'origin/feature-rcv-11870_openresty-nginx'.
nothing to commit, working directory clean
P.S.
I've checked out this question (git --git-dir not working as expected) and I know the workaround, but the question remains -- why git behaves differently for the similar projects?