【发布时间】:2021-12-23 22:55:10
【问题描述】:
我正在使用此逻辑,并且需要与此字符串“AMAZONFIX”匹配的唯一分支名称。
git for-each-ref --format='%(committerdate:short) %(authordate:relative) %(refname:lstrip=3)' --sort -committerdate refs/remotes/$REMOTE_NAME | while read date branch; do
printf "%s | %s %s %s %s %s | %50s\n" $date $branch
输出结果:
feature/core-xyz
dummy/AMAZON-bitMap
bugfix/AMAZONFIX-work
main/outlet-file
异常输出:
dummy/AMAZONFIX-bitMap
bugfix/work-place-AMAZONFIX
仅具有“AMAZONFIX”的分支名称
【问题讨论】:
-
通过 grep 将其用于 AMAZONFIX?
标签: git git-branch git-bash