uTools-Manuals/docs/git/git prune.html
2019-05-07 10:40:55 +08:00

1 line
3.8 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>名称Name</h2></div></div><div class="doc-postil"><div class="c-markdown"><p>git-prune  - 从对象数据库中删除所有不可访问的对象</p></div></div><div class="doc-postil"><div class="c-markdown"><h2>概要</h2></div></div><div class="doc-postil"><div class="c-markdown"><pre><code class="language-Bash">git prune [-n] [-v] [--expire &lt;expire&gt;] [--] [&lt;head&gt;…]</code></pre></div></div><div class="doc-postil"><div class="c-markdown"><h2>描述</h2></div></div><div class="doc-postil"><div class="c-markdown"><div class="table-wrapper"><table><thead><tr class="firstRow"><th style="text-align: left;"><div class="table-header"><p>注意</p></div></th><th style="text-align: left;"><div class="table-header"><p>在大多数情况下,用户应该运行 git gc它调用 git prune。请参阅下面的“注意”部分。</p></div></th></tr></thead><tbody></tbody></table></div></div></div><div class="doc-postil"><div class="c-markdown"><p>这将<code>git fsck --unreachable</code>使用所有可用的引用<code>refs/</code>,可选地包含在命令行中指定的其他对象集合,并修剪来自对象数据库的任何这些头对象不可访问的所有解压缩对象。另外,它通过运行修剪也在包中找到的未打包对象<code>git prune-packed</code>。它还从 .git / shallow 中删除任何 ref 无法访问的条目。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>请注意,无法访问,打包的对象将保留。如果不需要,请参阅 git-repack [1]。</p></div></div><div class="doc-postil"><div class="c-markdown"><h2>选项</h2></div></div><div class="doc-postil"><div class="c-markdown"><p>-n   --dry-run</p></div></div><div class="doc-postil"><div class="c-markdown"><p>不要删除任何东西; 只是报告它会删除什么。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>-v   --verbose</p></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>不要将更多的参数解释为选项。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>--expire &lt;time&gt;</p></div></div><div class="doc-postil"><div class="c-markdown"><p>只会过期比&lt;time&gt;更旧的松散对象。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>&lt;head&gt;</p></div></div><div class="doc-postil"><div class="c-markdown"><p>除了我们任何引用可访问的对象之外,还可以从列出的&lt;head&gt;中保持对象可访问。</p></div></div><div class="doc-postil"><div class="c-markdown"><h2>示例</h2></div></div><div class="doc-postil"><div class="c-markdown"><p>要修剪未由您的存储库使用的对象或从您的存储库借用以下内容的对象<code>.git/objects/info/alternates</code></p></div></div><div class="doc-postil"><div class="c-markdown"><pre><code class="language-Bash">$ git prune $(cd ../another &amp;&amp; git rev-parse --all)</code></pre></div></div><div class="doc-postil"><div class="c-markdown"><h2>注意</h2></div></div><div class="doc-postil"><div class="c-markdown"><p>在大多数情况下,用户不需要<code>git prune</code>直接调用,而是应该调用<code>git gc</code>,它可以处理修剪以及许多其他内务处理任务。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>有关修剪考虑哪些对象的描述,请参阅<code>git fsck</code>'s --unreachable 选项。</p></div></div><div class="doc-postil"><div class="c-markdown"><h2>也可以看看</h2></div></div><div class="doc-postil"><div class="c-markdown"><p>git-fsck[1], git-gc[1], git-reflog[1]</p></div></div></div>