I cloned a git repo and made some changes. I have to commit changes and then tag those committed changes. What should be the sequence of commands? Is it like: git clone
, git add
, git commit
, git push
, and then git tag
?
If not, what is the sequence ?
Tagging is generally used to capture a point in history that is used for a marked version release (i.e. v1. 0.1). A tag is like a branch that doesn't change. Unlike branches, tags, after being created, have no further history of commits.
List Local Git Tags. In order to list Git tags, you have to use the “git tag” command with no arguments. You can also execute “git tag” with the “-n” option in order to have an extensive description of your tag list. Optionally, you can choose to specify a tag pattern with the “-l” option followed by the tag pattern.
Well, in git, a tag is unique to a commit. However, if you really want to use a tag you already used before you will need to delete it from remote and local and recreate it.
You can tag a revision right after your commit or later (after a push). Then, you can push your tag with: git push origin [tagname]
.
So, yes, your sequence is ok. Take a look at this, for more details: https://git-scm.com/book/en/v2/Git-Basics-Tagging.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With