具有或不具有快进合并的功能分支?

时间:2015-06-09 18:23:27

标签: git git-merge git-flow fast-forward

我现在使用git很长一段时间了。但我从来没有以协作的方式使用它。我目前正在设立一个新项目并计划很多事情,其中​​包括:如何git?

好的,所以我开始阅读了一下,这是一个简单的决定:好吧,我们将使用功能分支工作流程。那很棒。

下一个问题:合并还是公关?合并! 细

上一个问题: FF还是非FF?
在功能分支工作流程中合并FF是否有意义?合并FF时,感觉整个功能分支故事都是浪费 使用非FF的任何缺点我都没有考虑过吗?

阅读" flat" (比如git log --oneline)git log我认为这些合并提交并不是什么大不了的事。但是当使用更奇特的git log --format ...时,当日志看起来像这样时,它会非常有用。最起码,我是这么想的。

*   e3f667e (HEAD, origin/master, master) Merge branch 'issue#1702'
|\
| * ec359fe (origin/issue#1702, issue#1702) 1702: two
| * 45a63b3 1702: two
* |   97bbec7 Merge branch 'issue#1701'
|\ \
| |/
|/|
| * f959cc9 (origin/issue#1701, issue#1701) 1701: two
| * 9217d3c 1701: one
|/
*   6c934ea Merge branch 'issue#1606'
|\
| * 365eac5 (origin/issue#1606, issue#1606) 1606: two
| * 95df1c9 1606: two
| * ad79b01 1606: one
|/
*   02dbcea Merge pull request #1 from babbelnedd/issue#1605
|\
| * d24d200 (origin/issue#1605, issue#1605) 1605: two
| * 7ef0a8e 1605: two
| * 5aac64d 1605: one
|/
* 585d8b9 Initial commit

2 个答案:

答案 0 :(得分:1)

你是绝对正确的,在进行FF合并的同时使用特征分支是没有意义的。

在主题分支中合并时,“Gitflow方式”是使用FF:

  

--no-ff标志使合并始终创建新的提交对象,即使可以使用快进执行合并。这样可以避免丢失有关功能分支历史存在的信息,并将所有一起添加功能的提交组合在一起。

Source

答案 1 :(得分:0)

看起来Gitflow标题用于快进合并。

来自Jeff Kreeftmeijer's blog的关于Git-Flow tool的引文。注意"快进"消息。

  

正如输出已经解释的那样,您现在可以使用新的分支来处理您的功能。像往常一样使用git,并在完成后使用功能完成功能完成:

$ git flow feature finish authentication
Switched to branch 'develop'
Updating 9060376..00bafe4
Fast-forward
 authentication.txt | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 authentication.txt
Deleted branch feature/authentication (was 00bafe4).

Summary of actions:
- The feature branch 'feature/authentication' was merged into 'develop'
- Feature branch 'feature/authentication' has been removed
- You are now on branch 'develop'
相关问题