PageRenderTime 24ms CodeModel.GetById 16ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1<link rel="stylesheet" type="text/css" media="screen"  href="css/screen.css" />
 2
 3<h1>Maintenance</h1>
 4
 5<h2>File System Check</h2>
 6
 7<p>File system check verifies integrity. Finds corrupt objects.</p>
 8
 9<pre><code>git fsck
10</code></pre>
11
12<p>Find orphaned objects that would be cleaned by prune</p>
13
14<pre><code>git fsck --orphaned
15</code></pre>
16
17<h2>Prune</h2>
18
19<p>Prune is a command that optimizes your repository by removing commits that are not orphaned.</p>
20
21<pre><code>git prune
22</code></pre>
23
24<p>or to see what is orphaned, but not actually touch them:</p>
25
26<pre><code>git prune --dry-run
27</code></pre>
28
29<p>or</p>
30
31<pre><code>git prune -n
32</code></pre>
33
34<h2>Garbage Collect</h2>
35
36<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>
37
38<pre><code>git gc
39</code></pre>
40
41<p>or to compress and optimize for space and speed</p>
42
43<pre><code>git gc --aggressive
44</code></pre>