cloning private repo using ruby-git -
i'm using ruby-git programmatically perform operations git repos hosted on github.
everything works fine when on public repos however, i'm not able clone private repos if have created ssh key on machine when code runs , added public 1 on github. make sure key setup have cloned repo directly terminal , repo cloned. key has been added ssh-agent , $ssh_auth_sock set. so, think issue related how use ruby-git gem.
here (simple) code
@repo = git.clone("git@github.com:#{repo_full_name}.git", path)
and here, if may helpful teh error
git::gitexecuteerror: git clone '--' 'git@github.com:user/repo.git' '/var/www/repo-root/user/repo' 2>&1:cloning '/var/www/repo-root/user/repo'... permission denied (publickey). fatal: not read am missing here?
thanks
do have git env config pointing @ ssh key path?
git.configure |config| # if want use custom git binary config.binary_path = '/git/bin/path' # if need use custom ssh script config.git_ssh = '/path/to/ssh/script' end
Comments
Post a Comment