美文网首页
GIT-Branch

GIT-Branch

作者: 小千 | 来源:发表于2020-05-14 18:26 被阅读0次

1、新建

git branch brName

2、新建并切换到分支

git checkout -b brName

3、删除

git branch -D brName

4、查看

  • git branch //查看本地分支
  • git branch -a // 查看所有分支(本地+远程)

5、给分支添加备注

git config branch.{branch_name}.description {这里添加注释}

// 给dev_1.0.1分支添加备注
git config branch.dev_1.0.1.description 这是1.0.1版本的分支

6、查看分支备注

git config branch.{branch_name}.description

// 查看dev_1.0.1分支的备注
git config branch.dev_1.0.1.description

// 打印如下
这是1.0.1版本的分支

添加git工具:git-br,可以直接通过 git branch 查看本地分支和描述

  • npm 下载安装:npm i -g git-br
  • 使用:git branch

相关文章

  • GIT-Branch

    1、新建 git branch brName 2、新建并切换到分支 git checkout -b brName ...

  • Git命令

    参考:https://git-scm.com/docs/git-branch git config 查看git c...

网友评论

      本文标题:GIT-Branch

      本文链接:https://www.haomeiwen.com/subject/bqdxohtx.html