Method: Git::Base#add

Defined in:
lib/git/base.rb

#add(*args) ⇒ Object

updates the repository index using the working directory content

@git.add('path/to/file')
@git.add(['path/to/file1','path/to/file2'])
@git.add(:all => true)

options:

:all => true

Parameters:

  • paths (String, Array)

    files paths to be added (optional, default=‘.’)

  • options (Hash)


221
222
223
224
225
226
227
# File 'lib/git/base.rb', line 221

def add(*args)
  if args[0].instance_of?(String) || args[0].instance_of?(Array)
    self.lib.add(args[0],args[1]||{})
  else
    self.lib.add('.', args[0]||{})
  end
end