• git branch -v、git branch -vv、git branch -verbose


    git文档

    git branch
    -v
    -vv
    --verbose
    When in list mode, show sha1 and commit subject line for each head, along with relationship to upstream branch (if any). If given twice, print the name of the upstream branch, as well (see also git remote show <remote>).
    

    翻译说明

    显示每个(本地)分支当前指向的提交记录的哈希值,以及和其上游分支的相对位置(如果有的话)
    -v-verbose是一个效果
    -vv会显示上游分支的名字

    举例

    $ git branch -vv
      cyr_branch   689c970 [origin/cyr_branch: behind 2] default
    * master       f1e2810 finally
      test-mysql   e2fa7b9 add .gitignore
      test-network 0d426ce add .gitignore
      xu_branch    e55fcf1 [origin/xu_branch: ahead 1] debug
      zfc_branch   e4a40a5 [origin/zfc_branch] merge
    

    cyr_branch的上游分支为origin/cyr_branch,前者落后后者2
    xu_branch的上游分支为origin/xu_branch,前者领先后者1
    zfc_branch的上游分支为origin/zfc_branch,两者同步
    test-mysqltest-network没有对应的上游分支
    master的上游分支为origin/master,但是没有显示,我猜测是因为这个对应关系是固定的,所以无需显示

    组合用法

    -a 显示所有本地及远端分支名

    $ git branch -a
      cyr_branch
    * master
      test-mysql
      test-network
      xu_branch
      zfc_branch
      remotes/origin/cyr_branch
      remotes/origin/master
      remotes/origin/xu_branch
      remotes/origin/zfc_branch
    

    -av

    $ git branch -av
      cyr_branch                689c970 [behind 2] default
    * master                    f1e2810 finally
      test-mysql                e2fa7b9 add .gitignore
      test-network              0d426ce add .gitignore
      xu_branch                 e55fcf1 [ahead 1] debug
      zfc_branch                e4a40a5 merge
      remotes/origin/cyr_branch 1e63522 cyr
      remotes/origin/master     f1e2810 finally
      remotes/origin/xu_branch  1c82da3 adjust db
      remotes/origin/zfc_branch e4a40a5 merge
    

    -avv

    $ git branch -avv
      cyr_branch                689c970 [origin/cyr_branch: behind 2] default
    * master                    f1e2810 finally
      test-mysql                e2fa7b9 add .gitignore
      test-network              0d426ce add .gitignore
      xu_branch                 e55fcf1 [origin/xu_branch: ahead 1] debug
      zfc_branch                e4a40a5 [origin/zfc_branch] merge
      remotes/origin/cyr_branch 1e63522 cyr
      remotes/origin/master     f1e2810 finally
      remotes/origin/xu_branch  1c82da3 adjust db
      remotes/origin/zfc_branch e4a40a5 merge
    
  • 相关阅读:
    [转]jquery开发自定义的插件总结
    [转]net中哈希表的使用 Hashtable
    [转]C#编程总结(三)线程同步
    [转]大白话系列之C#委托与事件讲解(三)
    [书目20160706]成功销售实用经典10步骤(美国培训与发展协会实用经典10步系列)
    [转]backbone.js template()函数
    [转]ASP.NET MVC Dynamic Themes
    [转]C#网络编程(订立协议和发送文件)
    [转]C#网络编程(异步传输字符串)
    [转]C#网络编程(同步传输字符串)
  • 原文地址:https://www.cnblogs.com/milesgo517/p/10992598.html
Copyright © 2020-2023  润新知