Last updated 2 February 2017. Created on 17 November 2012.
Edited by nitvirus, jsibley, judapriest, NarendraR. Log in to edit this page.

There are additional configuration steps needed to get Drush to work with git bash. This is due to the Drush Windows Installer package (Download the .msi at the bottom) not having a couple of necessary configurational options enabled by default to provide proper integration with git bash.

Fresh Drush Installation

When installing drush using the Drush 5.7/5.8/6.0 Windows Installer, this screen will appear:
custom setup options during a Drush install
There are three boxes that are marked "X" (not installed).

Click the box titled "Register Environmental Variables", then choose "Entire feature will be installed on local hard drive".

Drush installation step2

Then, click the box titled "cwRsync Optional Component box", then choose "Entire feature will be installed on local hard drive". Enabling this option will (with a few other tweaks) enable you to use the drush rsync command.

Proceed with the installation.

The "Register Environment Variables" option will update the PATH so that git bash knows where to find drush.

Fixing An Existing Drush Installation

You can also fix this problem after you have installed drush. These instructions were tested with Drush 5.7, 5.8, and 6.0. For later versions, check the required paths, as they may be different on other versions.

For Windows 7:

  1. Click on Start, then right click on My Computer (or Computer). Then choose Properties from the menu.
  2. When the Windows System Control Panel opens, click on Advanced Systems Settings (top left hand corner). The System Properties window will open and the Advanced tab will be active.
  3. Click on Environmental Variables, which is at the bottom of the Advanced Tab page.windows environment variables diag box
  4. There are two sets of Environmental Variables. DO NOT CHANGE THE SYSTEM VARIABLES. You can break a lot of stuff!! You want to change the User variables, which appear in the top portion of the Environment Variables window.
  5. The folder paths below must be included in the User PATH variable:
    • If the PATH environment variable already exists: edit it, add a ";" to the end of the current line, and paste the below folder paths onto the end of the existing path string that is in the Variable value text box.
    • If the PATH environment variable does not exist: add it via the New button and simply paste the below folder paths into the Variable Value text box.
      C:\ProgramData\Drush\;C:\Program Files (x86)\Drush\GnuWin32\bin;C:\Program Files (x86)\Drush\Php
      
  6. Click OK and close all of the windows we just opened, including the git bash window if you have it open.

For Windows 8:

Note: On Windows 8, there appears to be a bug on the Drush 6.0 Windows installer. Even if you choose the Register Environmental Variable option, the Drush 6.0 Windows Installer does NOT update the DOS Environmental Variables. Rats!!! So, you need to manually add the below paths to the DOS Environmental Variables.

  1. Open the Charms menu (by swiping from the right edge, or moving your mouse to the upper-right or lower-right corner of the screen), select Settings, then select Control Panel, then System and Security, then System.
  2. On the left side, select Advanced system settings. A System Properties dialogue box will open. Select the Advanced tab, then click Environment Variables.
  3. Under the User variables, either select Path if it exists and edit, or select New to create a new variable.
    • For Variable name, enter the following: Path (Note: This field is case-sensitive in Windows 8! Make sure you enter it as shown.)
    • For Variable value, enter the following:
      C:\ProgramData\Drush\;C:Program Files (x86)\Drush\GnuWin32\bin;C:\Program Files (x86)\Drush\Php;C:\Program Files (x86)\Drush\cwRsync\bin
      
  4. Click OK, then close all windows, including the git bash window if you have it open.

For Windows 10 and Drupal 7:

Note: For Drupal 7 (at least, installed from the zip file) there doesn't appear to be a Windows installer. So, you need to manually add the below paths to the DOS Environmental Variables.

  1. Open the Control Panel, then System and Security, then System.
  2. On the left side, select Advanced system settings. A System Properties dialogue box will open. Select the Advanced tab, then click Environment Variables.
  3. Under the User variables, either select Path if it exists and edit, or select New to create a new variable.
    • For Variable name, enter the following: Path (Note: not sure if this is case-sensitive in Windows 10)
    • For Variable value, enter the following (Note: the "..." represent the path to windrush, the folder extracted from the zip file):
      C:\...\windrush\vendor\drush\drush\;C:\...\windrush\vendor\bin;C:\...\windrush\php
      
    • The path to rsync.exe seems to be C:\...\windrush\tools\bin but rsync seemed to just hang. This will need additional testing.
  4. Click OK, then close all windows, including the git bash window if you have it open.

To test Drush's functionality in Git Bash, open a new git bash window and enter the drush command:

drush status

You should get something like:

$ drush status
 PHP configuration     :  C:\Program Files (x86)\Drush\Php\php.ini
 Drush version         :  5.8
 Drush configuration   :

If you receive an error message, then the above did not work. You can either use the --debug option to figure out where drush is throwing the error and correct the issue, or simply uninstall and re-install drush using the above instructions for a fresh configuration. You can also check Installing Drush on Windows.

Successfully Tested On:

  • Windows XP SP3 32-bit. Tested by:Cindy (11/10/2012)
  • Windows 7 Professional 32-bit. Tested by: densolis (11/01/2012)
  • Windows 7 Enterprise 64-bit. Tested by: densolis (10/15/2012)
  • Windows 7 Home Premium 64-bit. Tested by: charcotrill (9/24/2013)
  • Windows 8 Pro 64-bit. Tested by: charcotrill (9/24/2013)
  • Windows 8 Home 64-bit. Drush 6.0 installer. Tested by: EnjoyLife (11/30/2013)
  • Windows 10 Home. Drush 7.0 from zip file. Tested by: jsibley (9/21/15)

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

Nora McDougall’s picture

Does the same problem appear in the Windows Installer for Drush 5.8?

devotee’s picture

This works in 6.0 aswell.

Steve-CC’s picture

I am running Win 8.1 Update a touchscreen laptop. Just installed Drush with the 6.0 installer. It installed fine but I did have to modify path as explained above to get Bash integration.
As above - set Path=C:\ProgramData\Drush\;C:Program Files (x86)\Drush\GnuWin32\bin;C:\Program Files (x86)\Drush\Php;C:\Program Files (x86)\Drush\cwRsync\bin
It worked. Drush is running in the Bash window - Yay!

dekisha’s picture

Thanks a lot!