
[英]What are the differences between git branch, fork, fetch, merge, rebase and clone?
[英]What are the differences between -m, -s and -X arguments passed to git rebase?
您能用简单的英文解释一下,您应该传递给git rebase
-m
, -s
和-X
参数之间有什么区别(或它们如何工作)?
这些参数没有做其他事情,而是修改了变基将如何应用更改。
http://linux.die.net/man/1/git-rebase
-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将对该文件进行更改,而不是创建一个新文件。
其他参数修改合并的执行方式:
-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
具有三个可以使用的选项: ours
, theirs
和subtree
。 您将使用-X指定所需的那个。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.