module Git
def self.clone(repository_url, directory = nil, options = {})
-
(Git::Base)
- an object that can execute git commands in the context
Other tags:
- Example: Clone a repository and set multiple config options -
Example: Clone a repository and set a single config option -
Example: Create a bare repository in the directory `ruby-git.git` -
Example: Clone into a different directory `my-ruby-git` -
Example: Clone and then checkout the `development` branch -
Example: Clone into the default directory `ruby-git` -
Options Hash:
(**options)
-
:recursive
(Boolean
) -- After the clone is created, initialize -
:path
(Pathname
) -- The directory to clone into. May be used -
:origin
(String
) -- Use the value instead `origin` to track -
:mirror
(Boolean
) -- Set up a mirror of the source repository. -
:log
(Logger
) -- A logger to use for Git operations. Git -
:filter
(String
) -- Request that the server send a partial -
:depth
(Integer
) -- Create a shallow clone with a history -
:config
(Array, String
) -- A list of configuration options to -
:branch
(String
) -- The name of a branch or tag to checkout -
:bare
(Boolean
) -- Make a bare Git repository. See
Parameters:
-
options
(Hash
) -- The options for this command (see list of valid -
directory
(Pathname, nil
) -- The directory to clone into -
repository_url
(URI, Pathname
) -- The (possibly remote) repository url to clone
Other tags:
- See: https://git-scm.com/docs/git-clone#_git_urls_a_id_urls_a - GIT URLs
See: https://git-scm.com/docs/git-clone - git clone
def self.clone(repository_url, directory = nil, options = {}) clone_to_options = options.select { |key, _value| %i[bare mirror].include?(key) } directory ||= Git::URL.clone_to(repository_url, **clone_to_options) Base.clone(repository_url, directory, options) end