github - git ls-remote --heads 忽略特定分支
问题描述
git ls-remote --heads 显示远程分支中可用的引用以及相关的提交 ID。
git ls-remote --heads https://github.com/companyname/gitreponame release/branchname- 。
它给了我所有远程分支的列表,如下所示
- 发布/分支名称-1.0
- 发布/分支名称-2.0
- 发布/分支名称-3.0-TP
- 发布/分支名称-3.0
- 发布/分支名称-4.0-TP
- 发布/分支名称-4.0
有没有办法可以从我的列表中忽略这些-TP bnranches
解决方案
git ls-remote
不提供内置的方法来做到这一点,但你可以很容易地做到这一点grep
:
$ git ls-remote --heads origin | grep -ve '-TP$'
推荐阅读
- ios - 在 Main.storyboard 中绘制形状?
- java - recyclerview 不显示来自 Json 的多个数据
- unit-testing - 对 Google 的 Go API 客户端进行单元测试
- file-upload - Jmeter内存不足_文件上传测试
- r - 在 R 中的 foreach 循环中打印输出
- php - PHP strtotime() 在有效字符串上返回 false
- c++ - 将向量插入向量的向量中
- c# - 处理您的请求时发生错误。请求 ID:0HLEALBF2I2PS:00000007
- c++ - 如何排序QTableView忽略大小写
- static-libraries - 静态库包含来自其他头文件的未定义引用#define