git view remote branch, local branch, delete local branch

Source: Internet
Author: User

1 Viewing 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.3remotes/origin/master
2 Viewing local branches
12345 $ git branch* br-2.1.2.2master
3 Creating a branch
1234567891011 [email protected] /f/ggg/jingwei(br-2.1.2.2) $ git branch test $ git branch * br-2.1.2.2 mastertest
4 switching branches to test
1234567891011121314151617181920212223242526272829 [email protected] /f/ggg/jingwei (br-2.1.2.2)$ git branch* br-2.1.2.2mastertest[email protected] /f/ggg/jingwei (br-2.1.2.2)$ git checkout test M jingwei-server/src/main/java/com/taobao/jingwei/server/service/cmd/GetCustomerTarCmd.javaM jingwei-server/src/main/java/com/taobao/jingwei/server/util/ServerUtil.javaSwitched to branch ‘test‘[email protected] /f/ggg/jingwei (test)$ git branch br-2.1.2.2mastertest
5 Delete local branch git branch-d xxxxx
12345678910111213141516171819202122232425262728293031 $ git checkout br-2.1.2.2M jingwei-server/src/main/java/com/taobao/jingwei/server/service/cmd/GetCustomerTarCmd.javaM jingwei-server/src/main/java/com/taobao/jingwei/server/util/ServerUtil.java Switched to branch ‘br-2.1.2.2‘[email protected] /f/ggg/jingwei (br-2.1.2.2)$ git br* br-2.1.2.2mastertest[email protected] /f/ggg/jingwei (br-2.1.2.2)$ git br -d test Deleted branch test (was 17d28d9).[email protected] /f/ggg/jingwei (br-2.1.2.2)$ git br* br-2.1.2.2master
6 view local and remote branch-a. The front with the * number represents the branch where your current working directory is located
12345678910111213141516171819 [email protected] /f/ggg/jingwei (test)$ git branch -abr-2.1.2.2mastertestremotes/origin/HEAD -> origin/masterremotes/origin/br-2.1.2.1remotes/origin/br-2.1.2.2 remotes/origin/br-2.1.3remotes/origin/master

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

git view remote branch, local branch, delete local 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.