In GIT, if I checkout a tag I’ll get my working copy to that tag’s reference, i.e. the code will represent what I had at that time. I’m I correct?
Now, if I do that, and modify my code and commit. Where is that commit going? Will it sort of ‘auto-merge’? Meaning that if I push my commit, someone that clones the repo will also get the fix I did from the tag? Or otherwise, if I switch back to master, will I have the code modification available there?
The commit is still only stored locally. Only you have a reference to the modified version. If you want to make it available to others, you will also have to do a
git pushof your code to the given branch.Your commits are branch-specific, meaning if you change branches after committing, your changes will not carry over. However, when you change back to the branch, the commit will still be there.