I am cloning a single branch from a repository and creating a tag in a python script. The commands are as follows.
git clone -b master --single-branch
I ran into the same issue and was able to fix it by changing from
git tag -a testtag -m 'test'
to
git tag -a testtag -m "test"
I was running in Windows 7. Hope this helps :-)