Closed (fixed)
Project:
Drush
Version:
8.x-6.x-dev
Component:
Core Commands
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
26 Feb 2013 at 19:09 UTC
Updated:
10 Jun 2013 at 08:50 UTC
Not sure if this has been implemented. This would allow users to perform a git pull to the drush target
Command:
drush @mysite.remoteserver gp
Desired outcome:
Would perform a git pull from target site
Patch coming...
Comments
Comment #1
greg.1.anderson commentedYou might want to take a look at the Drush ssh command. What you want could nearly be done via:
I say nearly because the Drush ssh command does not cd to the Drupal site root before running the requested command. If it did this, then I think that would be preferable to a custom command that did just a git pull.
You might also want to take a look at the file example/example.bashrc, which defines a function 'gitd' that is supposed to allow command such as:
This presently is not working, although the following workaround is:
The manual 'cd' is awkward, of course. I think it would be helpful to make the Drush ssh command insert the 'cd' at the head of the user command automatically. A patch that did this would be welcome in the Drush issue queue.
Comment #2
chrisjlee commentedInteresting. Thanks greg, as always for the quick response. You've outlined some interesting flaws with my current theorized approach.
Nonetheless, you've given me some insight on how it could be achieved. I'll still attempt a different patch nonetheless.
Comment #3
greg.1.anderson commentedI wouldn't call them 'flaws'. It is perhaps a limitation to create a Drush command that will only execute a single git command ("pull"), but a remote git pull is still useful.
I fixed the 'gitd' command, so
gitd @remote pullnow works; the working version is now checked in to HEAD of Drush 8.x-6.x. The correct function looks like this:Comment #4
chrisjlee commentedComment #6
pere orgaI think this is about Drush and not Drush extras.
Sorry to reopen, but could this feature be extended to make easier pulling a contributed module?
See http://drupal.stackexchange.com/q/62934/10086
Comment #7
greg.1.anderson commentedIn 8.x-6.x-dev, the ssh command now automatically cd's to the Drupal root of the target, so you can now do this:
Perhaps this can be considered fixed? If not, please be more specific with request. It is unlikely that we will do anything as specific as the example quoted in #6 in Drush core. Note also that this issue is originally about git pull, whereas the Stack Exchange question is about git clone.
Comment #8
pere orgaOk, makes sense.
Comment #9.0
(not verified) commentedupdated issue summary