首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >传递给git重基的-m、-s和-X参数之间有什么不同?

传递给git重基的-m、-s和-X参数之间有什么不同?
EN

Stack Overflow用户
提问于 2013-08-23 13:37:27
回答 1查看 115关注 0票数 1

请用通俗易懂的英语解释一下-m-s-X参数之间的区别(或者它们是如何工作的),您应该把它们传递给git rebase

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-08-23 15:42:52

这些参数并没有做不同的事情,而是修改了重基将如何应用更改。

http://linux.die.net/man/1/git-rebase

代码语言:javascript
运行
复制
-m, --merge

Use merging strategies to rebase. When the recursive (default) merge strategy is used, this allows rebase to be aware of renames on the upstream side.
Note that a rebase merge works by replaying each commit from the working branch on top of the <upstream> branch. Because of this, when a merge conflict happens, the side reported as ours is the so-far rebased series, starting with <upstream>, and theirs is the working branch. In other words, the sides are swapped.

换句话说,不只是在每次提交时应用更改,而是将更改合并到分支中。例如,如果一个文件被重命名,git将对该文件进行更改,而不是创建一个新的文件。

其他参数修改合并的执行方式:

代码语言:javascript
运行
复制
-s <strategy>, --strategy=<strategy>

Use the given merge strategy. If there is no -s option git merge-recursive is used instead. This implies --merge.
Because git rebase replays each commit from the working branch on top of the <upstream> branch using the given strategy, using the ours strategy simply discards all patches from the <branch>, which makes little sense.

Git有多种方法来确定合并更改时要使用的更改。此选项指定要使用的选项。默认情况是recursive,但是根据情况,还有其他一些可能是合适的。

-X指定要传递给要使用的合并策略的任何其他选项。例如,recursive有三个可以使用的选项:ourstheirssubtree。您可以使用-X来指定您想要的哪一个。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18404279

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档