lib/Utils/Git.pm

Utils::Git

Utils::Git - Library for various git related functions

git_clone

git_clone('https://github.com/myrepo/tree/main'
    [, branch=>'development',
    depth=>1,
    single_branch=>1,
    skip_ssl_verification=>'true',
    output_log_file=>'git_clone.log']);

repository: Git repository url. Mandatory argument.

branch: Clone and checkout specific branch (or tag). Default: not defined

single_branch: Enable cloning of branch (or tag) only. Branch is the one specified in `branch` argument. This can speed up cloning process by omitting unnecessary branches. Default: not defined

depth: Shallow clone with truncated history to the specified number of commits. This speeds up cloning process by not cloning whole commit history. Default: not defined

skip_ssl_verification: Disable SSL verification. Can be useful in case of self signed certificates. Define this parameter ONLY if you want to skip verification. Default: undef

output_log_file: Log output into a file.

Generic wrapper around git clone command. Supports basic set of switches and output logging.