Generally we publish a new version to the online server will be a tag in the repository, so we can always view the tag version, that is, the tag is actually a snapshot in the repository. A git tag is similar to a branch, except that the branch is mutable and the label is immutable. Next we show you how to get the version that a tag in the remote repository points to.
1. If we git clone the entire remote repository, we can now
git checkout tag_name
can get the tag corresponding to the code, but because the tag is the equivalent of a snapshot, its code can not be modified.
2, if you need to modify the version of the tag specified, we can establish a branch for it, the instructions are as follows
git checkout-b branch_name tag_name equals git branch banch_name tag_name, git checkout branch_name two instructions
(where checkout indicates a switch branch,-b means new branch, branch_name refers to the newly created branch name, tag_name refers to an existing signature, that is, a previous version)
At this point, a branch of the corresponding version of Tag_name is established
3, clone a branch from the remote repository, the instructions are as follows
git clone remote_repo-b branch_name/save Path
(where Remote_repo represents the remote warehouse path and Branch_name represents the branch name to clone)
By doing this, we can get the code for the corresponding version of a tag from the remote repository.
git remote tab Download (remote branch)