diff options
Diffstat (limited to 'lib/git/lib.rb')
-rw-r--r-- | lib/git/lib.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/git/lib.rb b/lib/git/lib.rb index d857253..bc40e0c 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -212,11 +212,29 @@ module Git command('add', path) end + def remove(path = '.', opts = {}) + path = path.join(' ') if path.is_a?(Array) + + arr_opts = ['-f'] # overrides the up-to-date check by default + arr_opts << ['-r'] if opts[:recursive] + arr_opts << path + + command('rm', arr_opts) + end + def commit(message, opts = {}) arr_opts = ["-m '#{message}'"] arr_opts << '-a' if opts[:add_all] command('commit', arr_opts) end + + def reset(commit, opts = {}) + arr_opts = [] + arr_opts << '--hard' if opts[:hard] + arr_opts << commit.to_s if commit + command('reset', arr_opts) + end + private |