Method: Git::Lib#add
- Defined in:
- lib/git/lib.rb
#add(paths = '.', options = {})
updates the repository index using the working directory content
lib.add('path/to/file') lib.add(['path/to/file1','path/to/file2']) lib.add(:all => true)
options: :all => true :force => true
653 654 655 656 657 658 659 660 661 662 663 664 665 666 |
# File 'lib/git/lib.rb', line 653 def add(paths='.',={}) arr_opts = [] arr_opts << '--all' if [:all] arr_opts << '--force' if [:force] arr_opts << '--' arr_opts << paths arr_opts.flatten! command('add', *arr_opts) end |