git remote tab Download (remote branch)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.