Common git branch management commands

Source: Internet
Author: User

Git branch management Common commands view local branches [plain] git branch * dev master * represents the current dev branch to view remote branches [plain] git branch -- remote origin/dev origin/master to create branches [plain] git checkout-B new_branch note, new_branch code comes from the current branch switch branch [plain] git checkout another_branch and the Creation branch is poor-the B parameter pushes the local branch code to the remote server [plain] git push origin branch_name if the remote server does not this branch, the remote branch code of pull is automatically created to the local branch [plain] git pull origin branch_name to delete the local branch. Switch to another branch before deleting a branch [plain] Git checkout B git branch-d a delete a remote branch [plain] git push origin -- delete branch_name merge local branch [plain] git merge B assume that the current branch is dev, the above command is to merge the local B branch code into the current branch dev and merge the remote branch, which is almost the same as the previous one, [plain] git merge origin/B remote branch B is merged into the current local branch dev.

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.