git 查看远程分支本地分支删除本地分支
Posted imsomnus
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了git 查看远程分支本地分支删除本地分支相关的知识,希望对你有一定的参考价值。
1 查看远程分支
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
$ 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 查看本地分支
1
2
3
4
5
|
$ git branch * br-2.1.2.2 master |
3 创建分支
1
2
3
4
5
6
7
8
9
10
11
|
$ git branch test $ git branch * br-2.1.2.2 master test |
4 切换分支到test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
$ git branch * br-2.1.2.2 master test $ 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‘ $ git branch br-2.1.2.2 master * test |
5 删除本地分支 git branch -d xxxxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
$ 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‘ $ git br * br-2.1.2.2 master test $ git br -d test Deleted branch test (was 17d28d9). $ git br * br-2.1.2.2 master |
6 查看本地和远程分支 -a。前面带*号的代表你当前工作目录所处的分支
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
$ 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 |
转载:http://blog.it985.com/753.html
以上是关于git 查看远程分支本地分支删除本地分支的主要内容,如果未能解决你的问题,请参考以下文章