Git branch use

Source: Internet
Author: User

Branching operations 1. View Remote Branch
前面带*号的代表你当前工作目录所处的分支$ git branch -a * br-2.1.2.2  master  remotes/origin/HEAD -> origin/master  remotes/origin/br-2.1.2.1  remotes/origin/br-2.1.2.2  remotes/origin/br-2.1.3  remotes/origin/master
2. View local Branch
$ git branch* br-2.1.2.2  master
3. Create a Branch

GIT branch test

4. Switch the branch to test

git checkout Test

5. Delete local Branch

Git branch-d test

6. Push the branch to the remote branch

Git push origin test

7. Branch Transfer

When the git rebase:rebase command executes, it actually moves the branch point from C to G, so that the branch has a function from C to G

8. Branch Reset

Git Reset: The current working directory is completely rolled back to the specified version number, assuming that we have a-g five commit version, where C is the version number is BBAF6FB5060B4875B18FF9FF637CE118256D6F20, we executed the ' git reset Bbaf6fb5060b4875b18ff9ff637ce118256d6f20 ' Then there's only one a-c. Three submitted versions

Git branch use

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.