创建git流发布/修补程序的非交互式方式



从gitflow的文档中,我阅读了以下内容:

git-flow修补程序完成[-Fsumpkn]

-F在完成前从$ORIGIN提取
-s以加密方式签署发布标签
-u使用给定的GPG密钥进行数字签名(隐含-s)
-m使用给定的标记消息
-p完成后推至$ORIGIN
-k完成后保留分支
-n不要标记此版本
完成修补程序

现在我想创建一个没有用户交互的修补程序,所以我做了以下操作:

git flow hotfix finish '2.1.8' -m Hotfix

尽管有-m标志,我还是进入了编辑器,并被要求提供一条标记消息:

# File /Users/me/MyProject/.git/TAG_EDITMSG  
#
# Write a tag message

我是以错误的方式使用git流,还是这是一个错误?

@Besi,您必须在修补程序分支名称之前指定选项。

git flow hotfix finish -m Hotfix '2.1.8'

此外,该名称中不能有空格。例如,"新标签"将不起作用

git flow hotfix finish -m 'new tag' 2.1.8

错误:

flags:FATAL the available getopt does not support spaces in options

以下将起作用:

git flow hotfix finish -m 'new_tag' 2.1.8

这里是一个修补程序完成git别名:

hf = "!_() { b=$(git rev-parse --abbrev-ref HEAD) && git co master && git pl && git co develop && git pl && git co $b && git rebase master && h=$(echo $b | sed 's/hotfix\///g') && git flow hotfix finish -m 'new_tag' $h && git co master && git ps && git co develop && git ps && git ps --tags && git poo $b && git br -D $b;  }; _"

最新更新