简体   繁体   English

Gitflow - 为什么当我完成一个功能分支时没有打开编辑器?

[英]Gitflow - Why does no editor open when I finish a feature branch?

I use gitflow on linux.我在 linux 上使用 gitflow。

When I finish a hotfix branch, my vi editor opens and I can write a merge message.当我完成一个修补程序分支时,我的 vi 编辑器会打开,我可以编写合并消息。 The merge message is now in the commit history.合并消息现在在提交历史中。

But when I finish feature branches, no vi editor opens, I can't write no merge message.但是当我完成功能分支时,没有打开 vi 编辑器,我不能写没有合并消息。 So there is no trace in the commit history.所以提交历史中没有任何痕迹。

It's annoying.这很烦人。 Could someone explain me why ?有人可以解释我为什么吗? Is it a config problem ?是配置问题吗?

To create a feature branch: git flow feature start feature_branch .要创建功能分支: git flow feature start feature_branch

To finish a feature branch: git flow feature finish feature_branch .完成一个功能分支: git flow feature finish feature_branch According the doc finish is similar to: git checkout develop git merge feature_branch根据文档完成类似于: git checkout develop git merge feature_branch

Although I've been using the Git Flow branching strategy for years, I confess I've never used the git flow commands before, but I just tested them out and can confirm what you're witnessing, though some clarifications are in order.尽管多年来我一直在使用 Git Flow 分支策略,但我承认我以前从未使用过git flow命令,但我只是对其进行了测试,可以确认您所看到的内容,尽管需要进行一些说明。

As best I can tell, you aren't ever prompted to write a commit message for any of the merge commits .据我所知,您永远不会被提示为任何合并提交编写提交消息 However, when you finish a hotfix or release branch, you are prompted to write the Tag message , which happens to also be included in the merge commit message details (below the commit title), so it may look like you were writing the merge commit message.然而,当你完成一个hotfixrelease分支时,你会被提示写Tag message ,这恰好也包含在合并提交消息的细节中(在提交标题下面),所以看起来你在写合并提交信息。 Since only releases and hotfixes are tagged, this is why you aren't prompted with an editor when you finish feature branches.由于仅标记了版本和修补程序,这就是为什么在完成功能分支时不会提示您使用编辑器的原因。

Regarding the --no-ff merges, the following rules are in place:关于--no-ff合并,有以下规则:

  1. When finishing a release or hotfix branch, the merge is always performed with the --no-ff flag.完成发布修补程序分支时,始终使用--no-ff标志执行合并。
  2. When finishing a feature branch that has 2 or more new commits, the merge is performed with the --no-ff flag.完成具有 2 个或更多新提交的功能分支时,将使用--no-ff标志执行合并。
  3. When finishing a feature branch that has exactly 1 new commit, the merge is performed with the --ff flag (which is also the default for merge).当完成一个刚好有 1 个新提交的功能分支时,将使用--ff标志(这也是合并的默认值)执行合并。

Note that using -ff in the third rule means it will do a fast-forward if possible, meaning the merge commit is sometimes avoided, which is interesting because AFAIK this isn't suggested anywhere in the Git Flow documentation.请注意,在第三条规则中使用-ff意味着它会在可能的情况下进行快进,这意味着有时会避免合并提交,这很有趣,因为 AFAIK 在 Git Flow 文档中的任何地方都没有建议这样做。 It does make sense though since there is no information gain from forcing a merge commit when you only have a single commit to merge in. It still stays true to the --first-parent view of the develop branch showing all completed feature branches.这确实有意义,因为当您只有一个提交要合并时,强制合并提交不会获得任何信息。它仍然适用于显示所有已完成功能分支的develop分支的--first-parent视图。

Side Note: when I personally use Git Flow, I always force the merge commit even for single commit merges, because I put additional PR information in the customized merge commit messages.旁注:当我个人使用 Git Flow 时,我总是强制合并提交,即使是单次提交合并,因为我在自定义的合并提交消息中添加了额外的 PR 信息。 This is one of the reasons I don't use the git flow commands.这是我不使用git flow命令的原因之一。 (Besides, our SCM tool handles the merges of completed Pull Requests anyway, so no one would "finish" anything themselves.) (此外,我们的 SCM 工具无论如何都会处理已完成的合并请求,因此没有人会自己“完成”任何事情。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 GitFlow 功能完成不会将功能分支合并到开发中 - GitFlow feature finish does not merge the feature branch into develop 当我使用GitFlow时,为什么需要将发布分支合并到develop分支中? - Why does the release branch need to be merged into develop branch when I use GitFlow? 如何在 Intellij 编辑器中设置或集成 gitflow 以启动功能分支 - How to setup or integrate gitflow in Intellij editor to start feature branch 将 gitflow 功能分支发布到 gerrit - Publishing a gitflow feature branch to gerrit 在gitflow模型中创建修补程序分支或功能分支 - Create a hotfix branch or a feature branch in gitflow model 为什么需要在 GitFlow 中开发分支 - Why need Develop Branch in GitFlow 在gitflow中,如果我们有一个发布分支开放了一个星期,我们仍然可以将功能分支合并到开发中吗 - In gitflow if we have a release branch open for one week can we still merge feature branches into develop GitFlow:安全地将开发更改合并到功能分支 - GitFlow: safely merge develop changes to a feature branch 使用gitflow删除'feature'分支而不合并到master分支 - delete a 'feature' branch using gitflow without merging into master branch GitFlow:何时删除或冻结功能/发布分支​​? - GitFlow: when to delete or freeze feature/release branches?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM