git tag: fatal: Failed to resolve 'HEAD' as a valid ref

前端 未结 5 1157

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 

        
5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-17 18:54

    I had the same issue. You have to commit first before tagging

    git commit
    

    because you put tags on commits. So when there is no commit (like in your situation), you can't create a tag.

提交回复
热议问题