git flow release finish -m在cmd和Git Bash中给出了不同的行为

时间:2016-10-05 14:29:38

标签: git cmd git-bash git-flow

我正在为Windows中的git-flow自动化编写一个Bash脚本。

问题是:当我从cmd调用git flow release finish MYRELEASE -m "MESSAGE"时,它会在不询问输入(所需行为)的情况下运行。但是当我从Git Bash(MINGW64)那里做同样的事情时,它会要求合并消息(启动vim),我想避免它。

我试图在两个控制台中将git-config设置为git config --global core.mergeoptions --no-edit,但结果是一样的:Git Bash总是要求合并。

  • 为什么控制台的行为有所不同?
  • 如何让Git Bash停止询问合并消息?

更新:
两个控制台中git flow release finish 1.1.4 -m "v1.1.4" --showcommands的输出为

git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
git merge --no-ff release/1.1.4
Already up-to-date!
Merge made by the 'recursive' strategy.
git tag -a -m v1.1.4 1.1.4 1.1.4
git checkout develop
Switched to branch 'develop'
Your branch is up-to-date with 'origin/develop'.
git merge --no-ff 1.1.4
Already up-to-date!
Merge made by the 'recursive' strategy.
git branch -d release/1.1.4
Deleted branch release/1.1.4 (was 0a774fe).

Summary of actions:
- Release branch 'release/1.1.4' has been merged into 'master'
- The release was tagged '1.1.4'
- Release tag '1.1.4' has been back-merged into 'develop'
- Release branch 'release/1.1.4' has been locally deleted
- You are now on branch 'develop'

1 个答案:

答案 0 :(得分:1)

我只是在回答相关的question时找到了解决方案 您所要做的就是在脚本开头执行export GIT_MERGE_AUTOEDIT=no,在结尾处执行unset GIT_MERGE_AUTOEDIT
我仍然不知道为什么两个控制台不同,但这个解决方案会产生所需的行为,所以对我来说这已经足够了。