I have a git repository with an attached working tree that I'm pushing to a bare repo on a remote. The repository includes a submodule.

At the remote end: I check out the repo to a working tree git checkout -f having set GIT-DIR and GIT-WORK-TREE env vars.

In the working tree I now see all the expected files and an empty directory for the submodule ('MySubmodule').

I then do:

git submodule init
git submodule update

This errors with a message like:

working tree '../../workTree/' already exists
Clone of 'git@github.com:user/MySubmodule.git' into submodule path 'MySubmodule' failed

The empty submodule directory has now also 'vanished' from the working tree...

I'm not sure where I'm going wrong with this, basically I just want to check out the submodule files as I would with 'git submodule update'.

Edit
Report