1 <?xml version=
"1.0" encoding=
"iso-8859-1"?>
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">
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">
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 );
27 elemStyle = elem.style;
29 if ( elemStyle.display !=
"block" ) {
30 elemStyle.display =
"block"
32 elemStyle.display =
"none"
38 // Make codeblocks hidden by default
39 document.writeln(
"<style type=\"text/css\
">div.method-source-code { display: none }</style>" )
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>
55 <tr class=
"top-aligned-row">
56 <td><strong>In:
</strong></td>
58 <a href=
"../files/lib/git/author_rb.html">
62 <a href=
"../files/lib/git/base_rb.html">
66 <a href=
"../files/lib/git/branch_rb.html">
70 <a href=
"../files/lib/git/branches_rb.html">
74 <a href=
"../files/lib/git/diff_rb.html">
78 <a href=
"../files/lib/git/index_rb.html">
82 <a href=
"../files/lib/git/lib_rb.html">
86 <a href=
"../files/lib/git/log_rb.html">
90 <a href=
"../files/lib/git/object_rb.html">
94 <a href=
"../files/lib/git/path_rb.html">
98 <a href=
"../files/lib/git/remote_rb.html">
102 <a href=
"../files/lib/git/repository_rb.html">
103 lib/git/repository.rb
106 <a href=
"../files/lib/git/status_rb.html">
110 <a href=
"../files/lib/git/working_directory_rb.html">
111 lib/git/working_directory.rb
114 <a href=
"../files/lib/git_rb.html">
123 <!-- banner header -->
125 <div id=
"bodyContent">
129 <div id=
"contextContent">
131 <div id=
"description">
133 <a href=
"Git.html">Git
</a>/Ruby Library
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.
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.
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>)
150 <tr><td valign=
"top">License:
</td><td>MIT License
160 <div id=
"method-list">
161 <h3 class=
"section-bar">Methods
</h3>
163 <div class=
"name-list">
164 <a href=
"#M000001">bare
</a>
165 <a href=
"#M000004">clone
</a>
166 <a href=
"#M000003">init
</a>
167 <a href=
"#M000002">open
</a>
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 />
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>
208 <td class=
"context-item-value">'
1.0.3'
</td>
219 <!-- if method_list -->
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>
232 <div class=
"method-description">
234 open a bare repository
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
’t checkout stuff, commit things, etc.
239 but you can do most read operations
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">
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>
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>
263 <div class=
"method-description">
265 clones a remote repository
271 :bare =
> true (does a bare clone)
272 :repository =
> '/path/to/alt_git_dir'
273 :index =
> '/path/to/alt_index_file'
279 Git.clone('git://repo.or.cz/rubygit.git', 'clone.git', :bare =
> true)
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">
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>
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>
303 <div class=
"method-description">
305 initialize a new git repository, defaults to the current working directory
311 :repository =
> '/path/to/alt_git_dir'
312 :index =
> '/path/to/alt_index_file'
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">
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>
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>
336 <div class=
"method-description">
338 open an existing git working directory
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/,
350 :repository =
> '/path/to/alt_git_dir'
351 :index =
> '/path/to/alt_index_file'
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">
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>
373 <div id=
"validator-badges">
374 <p><small><a href=
"http://validator.w3.org/check/referer">[Validate]
</a></small></p>