got log and cat-file moved to pure ruby
[rubygit.git] / doc / classes / Git.html
blobb9a6a0a700081c2a4daf0c88484d8f20d20fcd9c
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE html
3 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7 <head>
8 <title>Module: Git</title>
9 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10 <meta http-equiv="Content-Script-Type" content="text/javascript" />
11 <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12 <script type="text/javascript">
13 // <![CDATA[
15 function popupCode( url ) {
16 window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
19 function toggleCode( id ) {
20 if ( document.getElementById )
21 elem = document.getElementById( id );
22 else if ( document.all )
23 elem = eval( "document.all." + id );
24 else
25 return false;
27 elemStyle = elem.style;
29 if ( elemStyle.display != "block" ) {
30 elemStyle.display = "block"
31 } else {
32 elemStyle.display = "none"
35 return true;
38 // Make codeblocks hidden by default
39 document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
41 // ]]>
42 </script>
44 </head>
45 <body>
49 <div id="classHeader">
50 <table class="header-table">
51 <tr class="top-aligned-row">
52 <td><strong>Module</strong></td>
53 <td class="class-name-in-header">Git</td>
54 </tr>
55 <tr class="top-aligned-row">
56 <td><strong>In:</strong></td>
57 <td>
58 <a href="../files/lib/git/author_rb.html">
59 lib/git/author.rb
60 </a>
61 <br />
62 <a href="../files/lib/git/base_rb.html">
63 lib/git/base.rb
64 </a>
65 <br />
66 <a href="../files/lib/git/branch_rb.html">
67 lib/git/branch.rb
68 </a>
69 <br />
70 <a href="../files/lib/git/branches_rb.html">
71 lib/git/branches.rb
72 </a>
73 <br />
74 <a href="../files/lib/git/diff_rb.html">
75 lib/git/diff.rb
76 </a>
77 <br />
78 <a href="../files/lib/git/index_rb.html">
79 lib/git/index.rb
80 </a>
81 <br />
82 <a href="../files/lib/git/lib_rb.html">
83 lib/git/lib.rb
84 </a>
85 <br />
86 <a href="../files/lib/git/log_rb.html">
87 lib/git/log.rb
88 </a>
89 <br />
90 <a href="../files/lib/git/object_rb.html">
91 lib/git/object.rb
92 </a>
93 <br />
94 <a href="../files/lib/git/path_rb.html">
95 lib/git/path.rb
96 </a>
97 <br />
98 <a href="../files/lib/git/remote_rb.html">
99 lib/git/remote.rb
100 </a>
101 <br />
102 <a href="../files/lib/git/repository_rb.html">
103 lib/git/repository.rb
104 </a>
105 <br />
106 <a href="../files/lib/git/status_rb.html">
107 lib/git/status.rb
108 </a>
109 <br />
110 <a href="../files/lib/git/working_directory_rb.html">
111 lib/git/working_directory.rb
112 </a>
113 <br />
114 <a href="../files/lib/git_rb.html">
115 lib/git.rb
116 </a>
117 <br />
118 </td>
119 </tr>
121 </table>
122 </div>
123 <!-- banner header -->
125 <div id="bodyContent">
129 <div id="contextContent">
131 <div id="description">
133 <a href="Git.html">Git</a>/Ruby Library
134 </p>
136 This provides bindings for working with git in complex interactions,
137 including branching and merging, object inspection and manipulation,
138 history, patch generation and more. You should be able to do most
139 fundamental git operations with this library.
140 </p>
142 This module provides the basic functions to open a git reference to work
143 with. You can open a working directory, open a bare repository, initialize
144 a new repo or clone an existing remote repository.
145 </p>
146 <table>
147 <tr><td valign="top"><a href="Git/Author.html">Author</a>:</td><td>Scott Chacon (<a href="mailto:schacon@gmail.com">schacon@gmail.com</a>)
149 </td></tr>
150 <tr><td valign="top">License:</td><td>MIT License
152 </td></tr>
153 </table>
155 </div>
158 </div>
160 <div id="method-list">
161 <h3 class="section-bar">Methods</h3>
163 <div class="name-list">
164 <a href="#M000001">bare</a>&nbsp;&nbsp;
165 <a href="#M000004">clone</a>&nbsp;&nbsp;
166 <a href="#M000003">init</a>&nbsp;&nbsp;
167 <a href="#M000002">open</a>&nbsp;&nbsp;
168 </div>
169 </div>
171 </div>
174 <!-- if includes -->
176 <div id="section">
178 <div id="class-list">
179 <h3 class="section-bar">Classes and Modules</h3>
181 Class <a href="Git/Author.html" class="link">Git::Author</a><br />
182 Class <a href="Git/Base.html" class="link">Git::Base</a><br />
183 Class <a href="Git/Branch.html" class="link">Git::Branch</a><br />
184 Class <a href="Git/Branches.html" class="link">Git::Branches</a><br />
185 Class <a href="Git/Diff.html" class="link">Git::Diff</a><br />
186 Class <a href="Git/GitExecuteError.html" class="link">Git::GitExecuteError</a><br />
187 Class <a href="Git/GitTagNameDoesNotExist.html" class="link">Git::GitTagNameDoesNotExist</a><br />
188 Class <a href="Git/Index.html" class="link">Git::Index</a><br />
189 Class <a href="Git/Lib.html" class="link">Git::Lib</a><br />
190 Class <a href="Git/Log.html" class="link">Git::Log</a><br />
191 Class <a href="Git/Object.html" class="link">Git::Object</a><br />
192 Class <a href="Git/Path.html" class="link">Git::Path</a><br />
193 Class <a href="Git/Remote.html" class="link">Git::Remote</a><br />
194 Class <a href="Git/Repository.html" class="link">Git::Repository</a><br />
195 Class <a href="Git/Status.html" class="link">Git::Status</a><br />
196 Class <a href="Git/WorkingDirectory.html" class="link">Git::WorkingDirectory</a><br />
198 </div>
200 <div id="constants-list">
201 <h3 class="section-bar">Constants</h3>
203 <div class="name-list">
204 <table summary="Constants">
205 <tr class="top-aligned-row context-row">
206 <td class="context-item-name">VERSION</td>
207 <td>=</td>
208 <td class="context-item-value">'1.0.3'</td>
209 </tr>
210 </table>
211 </div>
212 </div>
219 <!-- if method_list -->
220 <div id="methods">
221 <h3 class="section-bar">Public Class methods</h3>
223 <div id="method-M000001" class="method-detail">
224 <a name="M000001"></a>
226 <div class="method-heading">
227 <a href="#M000001" class="method-signature">
228 <span class="method-name">bare</span><span class="method-args">(git_dir)</span>
229 </a>
230 </div>
232 <div class="method-description">
234 open a bare repository
235 </p>
237 this takes the path to a bare git repo it expects not to be able to use a
238 working directory so you can&#8217;t checkout stuff, commit things, etc.
239 but you can do most read operations
240 </p>
241 <p><a class="source-toggle" href="#"
242 onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
243 <div class="method-source-code" id="M000001-source">
244 <pre>
245 <span class="ruby-comment cmt"># File lib/git.rb, line 51</span>
246 <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bare</span>(<span class="ruby-identifier">git_dir</span>)
247 <span class="ruby-constant">Base</span>.<span class="ruby-identifier">bare</span>(<span class="ruby-identifier">git_dir</span>)
248 <span class="ruby-keyword kw">end</span>
249 </pre>
250 </div>
251 </div>
252 </div>
254 <div id="method-M000004" class="method-detail">
255 <a name="M000004"></a>
257 <div class="method-heading">
258 <a href="#M000004" class="method-signature">
259 <span class="method-name">clone</span><span class="method-args">(repository, name, options = {})</span>
260 </a>
261 </div>
263 <div class="method-description">
265 clones a remote repository
266 </p>
268 options
269 </p>
270 <pre>
271 :bare =&gt; true (does a bare clone)
272 :repository =&gt; '/path/to/alt_git_dir'
273 :index =&gt; '/path/to/alt_index_file'
274 </pre>
276 example
277 </p>
278 <pre>
279 Git.clone('git://repo.or.cz/rubygit.git', 'clone.git', :bare =&gt; true)
280 </pre>
281 <p><a class="source-toggle" href="#"
282 onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
283 <div class="method-source-code" id="M000004-source">
284 <pre>
285 <span class="ruby-comment cmt"># File lib/git.rb, line 88</span>
286 <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">clone</span>(<span class="ruby-identifier">repository</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span> = {})
287 <span class="ruby-constant">Base</span>.<span class="ruby-identifier">clone</span>(<span class="ruby-identifier">repository</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span>)
288 <span class="ruby-keyword kw">end</span>
289 </pre>
290 </div>
291 </div>
292 </div>
294 <div id="method-M000003" class="method-detail">
295 <a name="M000003"></a>
297 <div class="method-heading">
298 <a href="#M000003" class="method-signature">
299 <span class="method-name">init</span><span class="method-args">(working_dir = '.', options = {})</span>
300 </a>
301 </div>
303 <div class="method-description">
305 initialize a new git repository, defaults to the current working directory
306 </p>
308 options
309 </p>
310 <pre>
311 :repository =&gt; '/path/to/alt_git_dir'
312 :index =&gt; '/path/to/alt_index_file'
313 </pre>
314 <p><a class="source-toggle" href="#"
315 onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
316 <div class="method-source-code" id="M000003-source">
317 <pre>
318 <span class="ruby-comment cmt"># File lib/git.rb, line 74</span>
319 <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">init</span>(<span class="ruby-identifier">working_dir</span> = <span class="ruby-value str">'.'</span>, <span class="ruby-identifier">options</span> = {})
320 <span class="ruby-constant">Base</span>.<span class="ruby-identifier">init</span>(<span class="ruby-identifier">working_dir</span>, <span class="ruby-identifier">options</span>)
321 <span class="ruby-keyword kw">end</span>
322 </pre>
323 </div>
324 </div>
325 </div>
327 <div id="method-M000002" class="method-detail">
328 <a name="M000002"></a>
330 <div class="method-heading">
331 <a href="#M000002" class="method-signature">
332 <span class="method-name">open</span><span class="method-args">(working_dir, options = {})</span>
333 </a>
334 </div>
336 <div class="method-description">
338 open an existing git working directory
339 </p>
341 this will most likely be the most common way to create a git reference,
342 referring to a working directory. if not provided in the options, the
343 library will assume your git_dir and index are in the default place (.git/,
344 .git/index)
345 </p>
347 options
348 </p>
349 <pre>
350 :repository =&gt; '/path/to/alt_git_dir'
351 :index =&gt; '/path/to/alt_index_file'
352 </pre>
353 <p><a class="source-toggle" href="#"
354 onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
355 <div class="method-source-code" id="M000002-source">
356 <pre>
357 <span class="ruby-comment cmt"># File lib/git.rb, line 65</span>
358 <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">working_dir</span>, <span class="ruby-identifier">options</span> = {})
359 <span class="ruby-constant">Base</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">working_dir</span>, <span class="ruby-identifier">options</span>)
360 <span class="ruby-keyword kw">end</span>
361 </pre>
362 </div>
363 </div>
364 </div>
367 </div>
370 </div>
373 <div id="validator-badges">
374 <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
375 </div>
377 </body>
378 </html>