GIT's checkout Origin/branch

Source: Internet
Author: User

1, from the Remote Repository clone project to the local, in addition to create a current remote head pointer to the branch, but also copy the remote Repository branch to the local, can be through git branch-a or git Branch-r to view all branch that are remotely copied to the local. The default name is: Origin/branchname
2. Locally you can checkout these remote Origin/branch that are copied locally, but you cannot modify these branch.
(Checkout to the remote Origin/branch, although you can make the appropriate changes to the file, create a new file, but when you go through git add, commit, and then re-checkout once the same remote/branch, The changes are gone. The following tips are made after checkout:

Warning: You are leaving 1 commits, not associated with any branches:

5438eb8 Composer.json

This may be a good time if you want to save them by creating a new branch.
Do the following:

Git branch new_branch_name 5438eb8
).

3, copying these remote branch to the local and do not allow the purpose of modification, is to let you know the local branch and the remote host branch changes.

GIT's checkout Origin/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.