gpt4 book ai didi

git - 有或没有快进 merge 的功能分支?

转载 作者:太空狗 更新时间:2023-10-29 14:18:38 28 4
gpt4 key购买 nike

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

好吧,我已经开始阅读了一些内容,这是一个简单的决定:好吧,我们将使用功能分支工作流。太棒了。

下一个问题: merge 还是 PR? merge !很好。

最后一个问题:FF 还是非 FF?
在功能分支工作流程中 merge FF 是否有意义?感觉在 merge FF 的时候整个特性分支的故事都浪费了。
使用非 FF 是否有任何我没有考虑到的缺点?


当阅读“平面”(如 git log --oneline)git log 时,我认为这些 merge 提交没什么大不了的。但是当使用一些更花哨的 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

最佳答案

您完全正确,在进行 FF merge 的同时使用功能分支毫无意义。

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

The --no-ff flag causes the merge to always create a new commit object, even if the merge could be performed with a fast-forward. This avoids losing information about the historical existence of a feature branch and groups together all commits that together added the feature.

( Source )

关于git - 有或没有快进 merge 的功能分支?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30739919/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com