Git: write to tag and then merge commit with host

I am mostly familiar with SVN. I used Git for a while, but did not do that which is extremely advanced. For my project, I created tags that mark individual releases. For example, I have a tag called v1.2.3 for a specific version of my project. I want to commit the fix for this tag and then merge it into master. How can I do it? I was looking for information on creating a branch from a tag, but I'm not sure if this is the right way to do this. Can I pass directly to the tag and then merge it into master?

+4
source share
1 answer

Consent to the tag is completely wrong, in my opinion, although svn, by design, allows this.

Say you have v1.2.3 release and you pass this tag - you get what? Still v1.2.3 or 1.2.3a or something like that? How do you restore version 1.2.3 later?

However, in git you can recreate tags. But I'm not sure that you should do this for any other case than โ€œI accidentally marked the wrong versionโ€ or in case you have โ€œmovingโ€ tags, such as โ€œlast stable revisionโ€.

In git you can 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 with your tag. Then you check this branch (there is a shortcut for this via git checkout -b). You make changes and recreate the tag.

You can subsequently delete your bugfix branch.

+6
source

All Articles