When you check out a tag, you have what's called a "detached head". Normally, Git's HEAD commit is a pointer to the branch that you currently have checked out. However, if you check out something other than a local branch (a tag or a remote branch, for example) you have a "detached head" -- you're not really on any branch. You should not make any commits while on a detached head.
It's okay to check out a tag if you don't want to make any edits. If you're just examining the contents of files, or you want to build your project from a tag, it's okay to git checkout my_tag
and work with the files, as long as you don't make any commits. If you want to start modifying files, you should create a branch based on the tag:
$ git checkout -b my_tag_branch my_tag
will create a new branch called my_tag_branch
starting from my_tag
. It's safe to commit changes on this branch.