zoukankan      html  css  js  c++  java
  • git branch(转)

    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

  • 相关阅读:
    windows基线检测脚本编写指南-powershell版
    2020蓝帽杯CTF Web 题
    2020天翼杯CTF Web 题
    Firefox 密码脱取
    利用iptables做端口转发
    Flask 快速学习笔记
    JSP无%%号命令执行一句话
    linux 后渗透凭据收集
    Fastjson漏洞利用
    Gogs远程命令执行利用
  • 原文地址:https://www.cnblogs.com/softidea/p/4896388.html
Copyright © 2011-2022 走看看