uTools-Manuals/docs/git/git merge-index.html
2019-04-08 23:22:26 +08:00

8 lines
4.2 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="c-markdown doc-markdown"><div class="doc-postil"><div class="c-markdown"><h2>名称</h2></div></div><div class="doc-postil"><div class="c-markdown"><p>git-merge-index  - 为需要合并的文件运行合并</p></div></div><div class="doc-postil"><div class="c-markdown"><h2>概要</h2></div></div><div class="doc-postil"><div class="c-markdown"><pre class="prism-token token language-javascript">git merge-index [-o] [-q] &lt;merge-program&gt; (-a | [--] &lt;file&gt;*)</pre></div></div><div class="doc-postil"><div class="c-markdown"><h2>描述</h2></div></div><div class="doc-postil"><div class="c-markdown"><p>这将查找索引中的&lt;file&gt;s并且如果有任何合并条目则将这些文件的SHA-1散列作为参数123空参数如果没有文件&lt;file&gt;作为参数4.三个文件的文件模式作为参数5,6和7传递。</p></div></div><div class="doc-postil"><div class="c-markdown"><h2>选项</h2></div></div><div class="doc-postil"><div class="c-markdown"><p>--</p></div></div><div class="doc-postil"><div class="c-markdown"><p>不要将更多的参数解释为选项。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>-a</p></div></div><div class="doc-postil"><div class="c-markdown"><p>针对需要合并的索引中的所有文件运行合并。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>-o</p></div></div><div class="doc-postil"><div class="c-markdown"><p>不要停止在第一次失败的合并,而是在一次完成所有的合并 - 即使先前的合并返回错误时继续合并,并且仅在所有合并之后返回错误代码。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>-q</p></div></div><div class="doc-postil"><div class="c-markdown"><p>不要抱怨失败的合并程序(合并程序失败通常表示合并期间发生冲突)。这是为了可能想要发出自定义消息的瓷器。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>如果<code>git merge-index</code>使用多个&lt;file&gt; s或-a调用则它将依次处理它们只有在合并返回非零退出代码时才会停止。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>通常,这是通过一个脚本调用 Git 模仿RCS包中的<code>merge</code>命令来运行的。</p></div></div><div class="doc-postil"><div class="c-markdown"><p><code>git merge-one-file</code>分发中包含调用的示例脚本。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>警报警报Git“合并对象顺序”与RCS <code>merge</code>程序合并对象顺序不同。在上述顺序中原件是第一个。但是3路合并程序的参数<code>merge</code>是将原件放在中间。不要问我为什么。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>示例:</p></div></div><div class="doc-postil"><div class="c-markdown"><pre class="prism-token token language-javascript">torvalds@ppc970:~/merge-test&gt; git merge-index cat MM
This is MM from the original tree.                        # original
This is modified MM in the branch A.                        # merge1
This is modified MM in the branch B.                        # merge2
This is modified MM in the branch B.                        # current contents</pre></div></div><div class="doc-postil"><div class="c-markdown"><p>亦或是</p></div></div><div class="doc-postil"><div class="c-markdown"><pre class="prism-token token language-javascript">torvalds@ppc970:~/merge-test&gt; git merge-index cat AA MM
cat: : No such file or directory
This is added AA in the branch A.This is added AA in the branch B.This is added AA in the branch B.fatal: merge program failed</pre></div></div><div class="doc-postil"><div class="c-markdown"><p>后面的例子显示了<code>git merge-index</code>一旦任何事情返回错误后,如何停止尝试合并(即,<code>cat</code>为 AA
文件返回错误,因为它不存在于原始文件中,因此<code>git merge-index</code>甚至没有尝试合并 MM 事物)。</p></div></div></div>