Method: Git::Base#add

Defined in:
lib/git/base.rb

#add(paths = '.', **options)

Update the index from the current worktree to prepare the for the next commit

Examples:

lib.add('path/to/file')
lib.add(['path/to/file1','path/to/file2'])
lib.add(all: true)

Parameters:

  • paths (String, Array<String>) (defaults to: '.')

    a file or files to be added to the repository (relative to the worktree root)

  • options (Hash)

Options Hash (**options):

  • :all (Boolean)

    Add, modify, and remove index entries to match the worktree

  • :force (Boolean)

    Allow adding otherwise ignored files

[View source]

164
165
166
# File 'lib/git/base.rb', line 164

def add(paths = '.', **options)
  self.lib.add(paths, options)
end