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。

  • 相关阅读:
    「HDU3640」I,Zombie
    气温变化折线图/matplotlib中文显示
    基本折线图
    根据统计数据画直方图
    matplotlib直方图绘制(hist)
    豆瓣Top250电影数据爬取学习
    pd.set_option参数设置
    django安装
    字典公共键
    字典排序
  • 原文地址:https://www.cnblogs.com/reality-soul/p/4964085.html
Copyright © 2011-2022 走看看