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

标签 git cmd git-bash git-flow

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

问题是:当我调用git flow release finish MYRELEASE -m "MESSAGE"时从 cmd 运行它不需要输入(期望的行为)。但是当我从 Git Bash (MINGW64) 执行相同操作时,它会要求 merge 消息(启动 vim),这是我想避免的。

我尝试将 git-config 设置为 git config --global core.mergeoptions --no-edit在两个控制台中,但结果是相同的:Git Bash 总是要求 merge 消息。

  • 为什么控制台的行为有所不同?
  • 如何让 Git Bash 停止请求 merge 消息?

更新:
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'

最佳答案

我刚刚在相关question的答案中自己找到了解决方案.
您所要做的就是在脚本开头执行 export GIT_MERGE_AUTOEDIT=no 并在脚本结尾处unset GIT_MERGE_AUTOEDIT
我仍然不知道为什么两个控制台有所不同,但此修复产生了所需的行为,因此对我来说已经足够了。

关于git flow release finish -m 在 cmd 和 Git Bash 中给出不同的行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39876749/

相关文章:

android - Android Studio 项目的典型 .gitignore 文件

javascript - 尝试将 BASH 安装到 VSCode 时无法编辑用户设置。 "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",

windows - 如何在 Windows 上从 "git gui"开始分离 "Git bash"?

java - 如何停止使用 "Gradle application plugin"运行的应用程序?

visual-c++ - 我可以保存opencv_traincascade结果吗?

c# - 恢复到 Git for visual studio 2012 中的先前提交

security - 如何设置不同用户只能看到某些部分的git存储库?

git 还原 : Is it possible to identify potentially conflicting commits before actual revert?

windows - 如何使用从当前名称中提取的子字符串重命名 Windows 文件

Java没有找到正确的路径