How do I accomplish something similar to svn tagging in Git?

My application needs to comply with the new specification.

So, I want to tag the version of my application as it stands. I want to be able to test this version in the future.

I have committed all my last changes.

And I:

git tag -a stable-pre-new-spec

      

When I execute:

git show stable-pre-new-spec

      

does it display the differences from my last commit ?! I don't quite understand what's going on.

Should I create a branch instead?

-2


a source to share


2 answers


I would use a branch in your case:

git checkout -b app_in_current_state

      



You can then continue development on the host computer while fixing bugs in the current state on the branch.

0


a source


Two things are going on. First, git revisions are revisions of the entire file tree. In contrast, I believe that cvs and svn provide separate version numbers to separate files. Thus, in cvs or svn, the "tag" operation disappears and is appended, for example, "stable-pre-new-spec" to file version 1.0.3, file 2 version 1.0.2, file3 version 2.0, file 4 version 1.3. 7, etc. Then, when you want to get this tag, the system goes and finds all fragments with this tag. In git, one revision already applies to the whole set, tags just give a different name.

Second - and this applies to many cm systems, including cvs and svn - git gives the same name to state and difference. git calls this combined thing a commit. So you ask for a version, and it shows you the difference between that and the immediately previous state. In git, the commit ID is actually the checksum of the entire stored contents of the tree; this is just conditional to show you a golden thorn .



In git, you can tag a commit or branch from it at any time after you create it.

+2


a source







All Articles