According to the git documentation, I should be able to run this command:
git submodule add -b . https://my/repo
And have a sub-module added, which will track head of the current branch of the super project.
Branch of repository to add as submodule. The name of the branch is recorded as submodule..branch in .gitmodules for update --remote. A special value of . is used to indicate that the name of the branch in the submodule should be the same name as the current branch in the current repository.
But when I do this, I get this error:
fatal: 'origin/.' is not a commit and a branch '.' cannot be created from it
I'm running git 2.21. Have I read the instructions completely wrong?