Skip to content

Commit 0cb1230

Browse files
Merge branch 'bakku-master'
2 parents 1feb6eb + c7a6983 commit 0cb1230

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

README.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ http://github.com/schacon/ruby-git
1313
You can install Ruby/Git like this:
1414

1515
$ sudo gem install git
16-
16+
1717
## Code Status
1818

1919
* [![Build Status](https://api.travis-ci.org/schacon/ruby-git.png)](https://travis-ci.org/schacon/ruby-git)
@@ -46,7 +46,7 @@ like:
4646

4747
Here are a bunch of examples of how to use the Ruby/Git package.
4848

49-
Ruby < 1.9 will require rubygems to be loaded.
49+
Ruby < 1.9 will require rubygems to be loaded.
5050

5151
```ruby
5252
require 'rubygems'
@@ -127,10 +127,10 @@ Here are the operations that need read permission only.
127127
g.grep('hello') # implies HEAD
128128
g.blob('v2.5:Makefile').grep('hello')
129129
g.tag('v2.5').grep('hello', 'docs/')
130-
g.describe()
130+
g.describe()
131131
g.describe('0djf2aa')
132132
g.describe('HEAD', {:all => true, :tags => true})
133-
133+
134134
g.diff(commit1, commit2).size
135135
g.diff(commit1, commit2).stats
136136
g.gtree('v2.5').diff('v2.6').insertions
@@ -149,7 +149,7 @@ Here are the operations that need read permission only.
149149
g.config # returns whole config hash
150150

151151
g.tags # returns array of Git::Tag objects
152-
152+
153153
g.show()
154154
g.show('HEAD')
155155
g.show('v2.8', 'README.md')
@@ -178,9 +178,11 @@ And here are the operations that will need to write to your git repository.
178178
g.add('file_path') # git add -- "file_path"
179179
g.add(['file_path_1', 'file_path_2']) # git add -- "file_path_1" "file_path_2"
180180

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"
184186

185187
g.commit('message')
186188
g.commit_all('message')

lib/git/lib.rb

+1
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,7 @@ def add(paths='.',options={})
519519
def remove(path = '.', opts = {})
520520
arr_opts = ['-f'] # overrides the up-to-date check by default
521521
arr_opts << ['-r'] if opts[:recursive]
522+
arr_opts << ['--cached'] if opts[:cached]
522523
arr_opts << '--'
523524
if path.is_a?(Array)
524525
arr_opts += path

0 commit comments

Comments
 (0)