Git-flow失败,"致命:没有标记消息?/标记失败.请再次运行完成重试"

Cur*_*urt 17 git git-flow

我正在使用git-flow来管理项目.发出时我收到以下消息git flow release finish foo:

fatal: no tag message? 
Tagging failed. Please run finish again to retry. 
Run Code Online (Sandbox Code Playgroud)

以下是使用全新的git存储库和单个文件重现的一系列步骤:

touch test.txt 
git init 
git add . 
git commit -m "Initial commit" 
git flow init 
[defaults accepted] 
git flow release start 1.0 
echo "Line 1" >> test.txt 
git add . 
git commit -am "Line added" 
git flow release finish '1.0' 
Run Code Online (Sandbox Code Playgroud)

此时,会弹出上面的错误消息,并调用Vim来添加标记.当我添加标签并保存时,我最终在主分支上,发布/ 1.0分支仍然存在.出了什么问题?Git流版本是0.4.1.

谢谢.

小智 10

我有同样的问题,这是一个core.editor设置,给我带来了问题.事实证明我已经设置了Gedit(不知道如何).尝试类似git config --global core.editor "vim"或编辑.gitconfig中的编辑器行.

  • 仅供参考,如果你想让gedit作为核心编辑器工作,它必须以`-s`和`-w`参数开头. (2认同)

Bur*_*tin 6

我通过在命令末尾添加 -n 解决了这个问题,如下所示。

git flow hotfix finish 'hotfix name' -n
Run Code Online (Sandbox Code Playgroud)

-n 表示没有标签。


Use*_*456 5

在完成发布/修补程序分支之前,请手动添加标签

git tag -a v0.1.2 -m "release_added"
Run Code Online (Sandbox Code Playgroud)

请不要在消息中添加空格,然后完成发行/修补程序,然后会显示一个窗口以添加消息

如果添加标签并且消息中有问题,请使用更改消息

git tag <tag name> <tag name> -f -m "<new message>"
Run Code Online (Sandbox Code Playgroud)

请不要在消息中添加空格