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
If you have access to the remote repository
cd /path/to/remote/repository git config --bool core.bare true