Can't set tag or commit as branch/version when create git submodule

I’m trying specify git submodule branch to tag:

git submodule add --branch -f \

or commit:

git submodule add --branch 5c0f8d23 -f \

But I get next error:

Reactivating local git directory for submodule 'src/test_submodule'.
fatal: Cannot update paths and switch to branch '' at the same time.
Did you intend to checkout 'origin/' which can not be resolved as commit?
Unable to checkout submodule 'src/test_submodule'

I see that it try checkout to origin/ instead tags.

I even try tags/ and refs/tags/, but it try checkout to origin/tags/ and origin/refs/tags/ in error message.

For master and other general branches all work fine.

I have next test_submodule refs:


git version 2.1.4

Can I specify submodule branch/version to tag or commit?

Git Baby is a git and github fan, let's start git clone.