Skip to main content
Error on title :)
Link
arrubiu
  • 3.3k
  • 2
  • 35
  • 64

Rub Run "git" on remote server with drush alias

Tweeted twitter.com/#!/StackDrupal/status/450452361933512704
Source Link
arrubiu
  • 3.3k
  • 2
  • 35
  • 64

Rub "git" on remote server with drush alias

I would like to launch git commands, on my production server, from my pc. The document root of the production application is a clone of the git repository.

On prod, on sites/all/drush/drushrc.php I've add this line:

<?php

// Drush aliases
$options['shell-aliases']['git-status'] = '!git status';

If I login on production and I execute "git status", everything works.

If I try to execute, from my pc "drush @mysite.prod git-status" I obtain:

fatal: Not a git repository (or any of the parent directories): .git
Command git status failed.

Note that if I try to run "drush @mysite.local git-status", works (and my local copy is like the production copy, the document root is the clone of git repository).

What's wrong? Document root directory declared on my alias is right (other commons drush commands work) and is a checkout of git repository.

Thanks.