博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
git branch(转)
阅读量:7083 次
发布时间:2019-06-28

本文共 1081 字,大约阅读时间需要 3 分钟。

git branch 
   git branch 不带参数:列出本地已经存在的分支,并且在当前分支的前面加“*”号标记,例如:
   #git branch
* master
   newbranch

   git branch -r 列出远程分支,例如:
   #git branch -r
   m/master -> origin_apps/m1_2.3.4
   origin_apps/hardware/test
   origin_apps/m1
   origin_apps/m1_2.3.4
   origin_apps/master

   git branch -a 列出本地分支和远程分支,例如:
   #git branch -a
   * master
   newbranch
   remotes/m/master -> origin_apps/m1_2.3.4
   remotes/origin_apps/hardware/test
   remotes/origin_apps/m1
   remotes/origin_apps/m1_2.3.4
   remotes/origin_apps/master
   git branch 创建一个新的本地分支,需要注意,此处只是创建分支,不进行分支切换,例如:
   #git branch newbranch2
   #git branch
   * master
   newbranch
   newbranch2
   当前的分支依然是master,不进行切换。
   git branch -m | -M oldbranch newbranch 重命名分支,如果newbranch名字分支已经存在,则需要使用-M强制重命名,否则,使用-m进行重命名。
   git branch -d | -D branchname 删除branchname分支
   git branch -d -r branchname 删除远程branchname分支
例子:
git help branch中的一个例子:
   $ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6
   $ cd my2.6
   $ git branch my2.6.14 v2.6.14   
   $ git checkout my2.6.14      
   第三行符合git branch <branchname> [<start-point>]的格式,即以v2.6.14为start-point,创建新的本地分支branchname。

http://blog.csdn.net/xiruanliuwei/article/details/6919319

你可能感兴趣的文章
Install and Configure OpenStack Telemetry Metering Service (Ceilometer) for Ubuntu 14.04
查看>>
Linux 技巧:让进程在后台可靠运行的几种方法
查看>>
程序员辞职卖卷饼,4天挣了1个月工资……所以我应该改行卖卷饼吗?
查看>>
作业:Rsync+shell脚本完成自动化备份
查看>>
DKH企业级大数据解决方案的优势介绍
查看>>
arm嵌入式培训学校浅聊单片机、ARM、FPGA 、嵌入式开发的特点
查看>>
lvs+keepalived原理
查看>>
windows安装
查看>>
C实现2台主机间的passwordLess,基于配置文件批量建立主机之间的passwordless
查看>>
私有云桌面和公有云桌面的区别是什么
查看>>
Locale java
查看>>
【转】Android 环境变量 和 AVD 环境变量 配置
查看>>
使用Weka进行数据挖掘
查看>>
关于计算机信息系统集成项目经理资质申报的补充通知
查看>>
飞机大战小游戏
查看>>
中国物联网的随笔
查看>>
VMware虚拟机linux系统时间同步的解决办法
查看>>
我的友情链接
查看>>
Linux网络管理工具
查看>>
Linux磁盘管理7
查看>>