Git: committing to a tag and then merging commit to master
git, git-branch, git-merge, git-tag
Solution
Committing to a tag is entirely wrong, in my opinion, although svn, by design allows it.
Say, you have a release v1.2.3 and you commit to that tag - you get what? Still v1.2.3 or 1.2.3a or something like that? How do you recover what version 1.2.3 was later on?
Nevertheless, in git you can recreate tags. But I am not sure if you should do that for any other case than "I accidentally tagged the wrong version" or in case you have "moving" tags like "last stable revision".
In git you could do:
git branch v1.2.3-bugfix v1.2.3 [v1.2.3-bugfix is your branch, v1.2.3 the tag]
git checkout v1.2.3-bugfix
-- do your changes --
git add ...
git commit
git tag -f v1.2.3
That is, first you create a branch starting from your tag. Then you check out that branch (there is shortcut for that via git checkout -b). You commit your changes and re-create the tag.
Afterwards, you could delete your bugfix-branch.
Problem
I'm mainly familiar with SVN. I have been using Git for a while, but haven't done things that are extremely advanced. For my project, I have been creating tags that mark individual releases. For example, I have a tag called `v1.2.3` for a particular release of my project. I want to commit a bugfix to that tag and then merge that into master. How do I go about doing that? I looked up information about creating a branch from a tag, but I am not sure if that's the right way of doing it. Can I commit directly to a tag and then merge it into master?