3

I have multiple private git accounts set up with SSH system's keychain authentication for each git repo.

It works to clone private git repos from command line:

git clone git@git_ssh_alias:git-account/some_repo.git

The git_ssh_alias is the alias name declared in .ssh/config file that specifies the SSH key that should be used.

However, this same clone doesn't work when running from make file via Drush script as following.

From Make file:

projects[theme_name][type] = "theme"
projects[theme_name][version] = 7.x-1.0
projects[theme_name][download][type] = "git"
projects[theme_name][download][url] = "git@git_ssh_alias:git-account/some_repo.git"
projects[theme_name][download][branch] = "master"

From Drush script:

drush_invoke_process('@self', 'make', array($make_file), $options)

where $make_file is a path to a make file and options are:

$options = array();
$options['no-core'] = TRUE;
$options['yes'] = TRUE;
$options['contrib-destination'] = 'sites/all';

My question: How to clone private git repo with local ssh keychain authentication enabled?

3
  • I would have expected it to work like you describe... You could try the gitcloneparams option. Mar 2, 2014 at 18:55
  • Could it be, you are drush as a different user -- not as the one you use to test git from command line?
    – Mikhail T.
    Oct 1, 2014 at 20:03
  • Verify you're using the right RSA keys by ssh-add -l. If you've multiple keys, use only one.
    – kenorb
    Nov 25, 2015 at 13:33

1 Answer 1

0

Using modules and not theme_name may resolve this.

projects[modules][type] = modules
projects[modules][download][type] = git
projects[modules][download][url] = git@bitbucket.org:company/repo.git
projects[modules][download][branch] = master

Here are a couple of useful links:

https://groups.drupal.org/node/194303#comment-918073 http://www.systemseed.com/blog/drush-make-private-git-repository-github

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.