I’ve created a repository on Github, and at some point I’ve created a tag on the master. Now for the branche gh-pages I want to create a tag also with the same name. But thats not possible. I can see that the tag only applies to the master, so why can’t I apply the same tag name on different branches ?
cheers
Luca
You can’t apply the "same tag" multiple times, as a tag is there to reference one and only one commit.
(See "Tag multiple branches in git?" for more)
If you
git checkout -b gh-pagesfrommaster, then you will be on a commit referenced both bymasterand the new branchgh-pages.In that instance, one tag would be valid for both branches.
But once you start to create new commits in the new branches, you will apply one uniquely named tag to commits in that new branch only.
Kep in mind however that a tag isn’t linked to a branch (if you were to rebase that branch on top of
master, and then mergemaster… you would end up again with oneHEADreferenced by the two branches: all the tags would be again part of the two branches).A tag is only linked to a commit.
Update August 2016: Simpler GitHub Pages publishing now allows to keep your page files in a subfolder of the same branch (no more
gh-pagesneeded):So here, you could tag
master, referring to both contents.