[Others-3] create and manage git branches

Source: Internet
Author: User

1. Create a local branch

Git branch name, for example: git branch 2.0.1.20120806 Note: 2.0.1.20120806 is the branch name, which can be defined at will.
2. Switch the local branchGit checkout branch name, for example, switch from Master to branch: git checkout 2.0.1.20120806
3. The remote branch is pushed to the server by the local branch. For example, the master node is the most typical remote Branch (default ).Git push Origin 2.0.1.20120806
4. The remote branch must be distinguished from the local branch. Therefore, when pulling a specific branch from the server, you must specify the name of the remote branch.Git checkout -- track origin/2.0.1.20120806 note that this command has the -- track parameter, so git1.6.4 or above is required! In this way, git automatically switches to the branch.
5. Submit the branch data to the remote server.Git push origin <local_branch_name >:< remote_branch_name> example: git push Origin 2.0.1.20120806: 2.0.1.20120806 submit a job in this way if it is not in the current branch. If 2.0.1.20120806 Branch, you can also directly submit git push
6. Delete remote BranchGit push origin: Develop

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.