Git: view remote branches, local branches, and delete local branches. git: View branch Deletion

Source: Internet
Author: User

Git: view remote branches, local branches, and delete local branches. git: View branch Deletion
1. view remote branches

123456789101112131415 $ 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 branches
12345 $ git branch * br-2.1.2.2 master
3. Create a branch
1234567891011 shuohailhl@SHUOHAILHL-PC /f/ggg/jingwei (br-2.1.2.2) $ git branch test $ git branch * br-2.1.2.2 master test
4 switch branch to test
1234567891011121314151617181920212223242526272829 shuohailhl@SHUOHAILHL-PC /f/ggg/jingwei (br-2.1.2.2) $ git branch * br-2.1.2.2 master test shuohailhl@SHUOHAILHL-PC /f/ggg/jingwei (br-2.1.2.2) $ git checkout test M jingwei-server/src/main/java/com/taobao/jingwei/server/service/cmd/GetCustomerTarCmd.java M jingwei-server/src/main/java/com/taobao/jingwei/server/util/ServerUtil.java Switched to branch 'test' shuohailhl@SHUOHAILHL-PC /f/ggg/jingwei (test) $ git branch br-2.1.2.2 master test
5. Delete the local branch git branch-d xxxxx
12345678910111213141516171819202122232425262728293031 $ git checkout br-2.1.2.2 M jingwei-server/src/main/java/com/taobao/jingwei/server/service/cmd/GetCustomerTarCmd.java M jingwei-server/src/main/java/com/taobao/jingwei/server/util/ServerUtil.java Switched to branch 'br-2.1.2.2' shuohailhl@SHUOHAILHL-PC /f/ggg/jingwei (br-2.1.2.2) $ git br * br-2.1.2.2 master test shuohailhl@SHUOHAILHL-PC /f/ggg/jingwei (br-2.1.2.2) $ git br -d test Deleted branch test (was 17d28d9). shuohailhl@SHUOHAILHL-PC /f/ggg/jingwei (br-2.1.2.2) $ git br * br-2.1.2.2 master
6. View local and remote branch-. The branch with the asterisk (*) in front of the current working directory
12345678910111213141516171819 shuohailhl@SHUOHAILHL-PC /f/ggg/jingwei (test) $ git branch -a br-2.1.2.2 master test 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

Git most detailed address link: http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/001373962845513aefd77a99f4145f0a2c7a7ca057e7570000

Related Article

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.