@@ -13,7 +13,7 @@ http://github.com/schacon/ruby-git
13
13
You can install Ruby/Git like this:
14
14
15
15
$ sudo gem install git
16
-
16
+
17
17
## Code Status
18
18
19
19
* [ ![ Build Status] ( https://api.travis-ci.org/schacon/ruby-git.png )] ( https://travis-ci.org/schacon/ruby-git )
46
46
47
47
Here are a bunch of examples of how to use the Ruby/Git package.
48
48
49
- Ruby < 1.9 will require rubygems to be loaded.
49
+ Ruby < 1.9 will require rubygems to be loaded.
50
50
51
51
``` ruby
52
52
require ' rubygems'
@@ -127,10 +127,10 @@ Here are the operations that need read permission only.
127
127
g.grep(' hello' ) # implies HEAD
128
128
g.blob(' v2.5:Makefile' ).grep(' hello' )
129
129
g.tag(' v2.5' ).grep(' hello' , ' docs/' )
130
- g.describe()
130
+ g.describe()
131
131
g.describe(' 0djf2aa' )
132
132
g.describe(' HEAD' , {:all => true , :tags => true })
133
-
133
+
134
134
g.diff(commit1, commit2).size
135
135
g.diff(commit1, commit2).stats
136
136
g.gtree(' v2.5' ).diff(' v2.6' ).insertions
@@ -149,7 +149,7 @@ Here are the operations that need read permission only.
149
149
g.config # returns whole config hash
150
150
151
151
g.tags # returns array of Git::Tag objects
152
-
152
+
153
153
g.show()
154
154
g.show(' HEAD' )
155
155
g.show(' v2.8' , ' README.md' )
@@ -178,9 +178,11 @@ And here are the operations that will need to write to your git repository.
178
178
g.add(' file_path' ) # git add -- "file_path"
179
179
g.add([' file_path_1' , ' file_path_2' ]) # git add -- "file_path_1" "file_path_2"
180
180
181
-
182
- g.remove(' file.txt' )
183
- g.remove([' file.txt' , ' file2.txt' ])
181
+ g.remove() # git rm -f -- "."
182
+ g.remove(' file.txt' ) # git rm -f -- "file.txt"
183
+ g.remove([' file.txt' , ' file2.txt' ]) # git rm -f -- "file.txt" "file2.txt"
184
+ g.remove(' file.txt' , :recursive => true ) # git rm -f -r -- "file.txt"
185
+ g.remove(' file.txt' , :cached => true ) # git rm -f --cached -- "file.txt"
184
186
185
187
g.commit(' message' )
186
188
g.commit_all(' message' )
0 commit comments