Method: Git::Lib#clone
- Defined in:
- lib/git/lib.rb
#clone(repository_url, directory, opts = {}) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
TODO:
make this work with SSH password or auth_key
Clones a repository into a newly created directory
166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/git/lib.rb', line 166 def clone(repository_url, directory, opts = {}) @path = opts[:path] || '.' clone_dir = opts[:path] ? File.join(@path, directory) : directory args = build_args(opts, CLONE_OPTION_MAP) args.push('--', repository_url, clone_dir) command('clone', *args, timeout: opts[:timeout]) return_base_opts_from_clone(clone_dir, opts) end |