/workbook/htmls/20-Repo_Maintenance.html
http://github.com/matthewmccullough/git-workshop · HTML · 44 lines · 26 code · 18 blank · 0 comment · 0 complexity · ae193c9973a93cea4ad9d7f71731852e MD5 · raw file
- <link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" />
- <h1>Maintenance</h1>
- <h2>File System Check</h2>
- <p>File system check verifies integrity. Finds corrupt objects.</p>
- <pre><code>git fsck
- </code></pre>
- <p>Find orphaned objects that would be cleaned by prune</p>
- <pre><code>git fsck --orphaned
- </code></pre>
- <h2>Prune</h2>
- <p>Prune is a command that optimizes your repository by removing commits that are not orphaned.</p>
- <pre><code>git prune
- </code></pre>
- <p>or to see what is orphaned, but not actually touch them:</p>
- <pre><code>git prune --dry-run
- </code></pre>
- <p>or</p>
- <pre><code>git prune -n
- </code></pre>
- <h2>Garbage Collect</h2>
- <p>GC compacts old loose commits into pack files and <code>prune</code>s orphan commits. It is a superset of the <code>prune</code> command and is more commonly run than <code>prune</code>.</p>
- <pre><code>git gc
- </code></pre>
- <p>or to compress and optimize for space and speed</p>
- <pre><code>git gc --aggressive
- </code></pre>