请用通俗易懂的英语解释一下-m、-s和-X参数之间的区别(或者它们是如何工作的),您应该把它们传递给git rebase。
发布于 2013-08-23 15:42:52
这些参数并没有做不同的事情,而是修改了重基将如何应用更改。
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来指定您想要的哪一个。
https://stackoverflow.com/questions/18404279
复制相似问题