为什么在git命令git merge中两次被称为-f -no-ff< branch-name>?

发布于 2025-01-24 16:08:37 字数 383 浏览 3 评论 0 原文

在查找语法时,涉及一个破折号与两个破折号的GIT参数。我遇到了这篇文章,其中解释了单个破折号”带有一个破折号和双重破折号的多个单个字母参数适用于多字母参数。

因此,在 git Merge的情况下-No-ff< branch-name> is > -ff 调用 -f 两次?如果是这样,为什么?

While looking up syntax for git parameters involving one dash versus two dashes. I came across this post which explains that single dashes allow you to specify multiple single letter parameters with one dash and double dashes are for multi-letter parameters.

So in the case of git merge --no-ff <branch-name> is -ff calling -f twice? If so, why?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

桃扇骨 2025-01-31 16:08:37

因此,在 git合并的情况下-no-ff&lt; branch-name&gt; -ff 调用 -f 两次?

不,不是。

- No-FF 是完整的长选项。长选项可能包含破折号,因为只有Whitespace将命令行参数分开,并且一个长选项始终是整个命令行参数(与简短选项不同,其中一个命令行参数可以包含多个选项,.ie -bar 包含 B a r )。

So in the case of git merge --no-ff <branch-name> is -ff calling -f twice?

No, it isn't.

--no-ff is the complete long option. Long options may contain dashes, because only whitespace separates command line arguments and a long option is always an entire command line argument (unlike short options, where one command line argument can contain multiple options, .i.e. -bar contains b a and r).

泅渡 2025-01-31 16:08:37

- ff 仅表示快速前进

从语义上讲:

  • a 快速向前的合并 当前中的其他功能分支是一个微不足道的合并,其中<<代码>功能只是“碰撞”到其他(这不是总是可能的,只有当其他功能)

  • a in 功能中的其他的非快速合并是“ true Merge”,它导致创建新的合并合并在分支功能中的合并,然后有两个父母提交。


参考

另请参见在线repman,该recman指示有三个相关的CLI标志:

https://git-scm.com/docs/git-merge#documentation/git-merge.txt----ff

- ff
- No-FF
- 仅FF-

指定合并历史记录已经成为当前历史的后代时如何处理合并。

--ff just means fast forward.

Semantically speaking:

  • a fast-forward merge of a branch other in a current feature branch is a trivial merge where the SHA1 of feature is just "bumped" to other (this is not always possible, only if other is a child-commit-or-so of feature)

  • a non-fast-forward merge of other in feature is "a true merge" which results in the creation of a new merge commit in branch feature, which then has two parent commits.

Reference

See also the online refman which indicates there are three related CLI flags:

https://git-scm.com/docs/git-merge#Documentation/git-merge.txt---ff

--ff
--no-ff
--ff-only

Specifies how a merge is handled when the merged-in history is already a descendant of the current history.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文