Git-flow 失败并显示“致命:没有标记消息?/标记失败。请再次运行完成以重试”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6500965/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 05:37:23  来源:igfitidea点击:

Git-flow fails with "fatal: no tag message? / Tagging failed. Please run finish again to retry"

gitgit-flow

提问by CuriousYogurt

I am using git-flowto manage a project. I am getting the following message when issuing git flow release finish foo:

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

fatal: no tag message? 
Tagging failed. Please run finish again to retry. 

Here is the sequence of steps to reproduce, with a brand new git repository and a single file:

以下是使用全新的 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' 

At this point, error message above pops up, and Vim is called up to add a tag. When I add the tag and save, I end up on the master branch, with the release/1.0 branch still existing. Any ideas what is going wrong? Git flow version is 0.4.1.

此时弹出上面的错误信息,调用Vim添加标签。当我添加标签并保存时,我最终在 master 分支上,而 release/1.0 分支仍然存在。任何想法出了什么问题?Git 流程版本是 0.4.1。

Thank you.

谢谢你。

回答by Coccodrillo

I had the same problem, it was a core.editor setting that was giving me problems. It turned out I had set up Gedit (no idea how). Try something like git config --global core.editor "vim"or edit the editor line in your .gitconfig.

我遇到了同样的问题,是 core.editor 设置给我带来了问题。结果我已经设置了 Gedit(不知道如何设置)。尝试类似git config --global core.editor "vim"或编辑 .gitconfig 中的编辑器行。

回答by User123456

before finish your release/hotfix branch add the tag manually

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

git tag -a v0.1.2 -m "release_added"

please don`t add spaces in message then finish the release/hotfix then you will be given a window to add a message

请不要在消息中添加空格,然后完成发布/修补程序,然后您将看到一个添加消息的窗口

if you add the tag and you have issue in message , change the message using

如果您添加标签并且您在消息中遇到问题,请使用更改消息

git tag <tag name> <tag name> -f -m "<new message>"

please don`t add spaces in message

请不要在消息中添加空格