Submitted by rfay on
Cygwin is a great set of Unix/Linux utilities for Windows. Here are quickstart instructions for using it in a Drupal context (for git, patch, ssh, or whatever)
- Grab the small setup.exe from http://cygwin.com
- Run it. If you're on Windows Vista or later, you'll want to run the setup with administrative privileges (Right click on setup.exe and "Run as administrator")
- Take all the defaults - we'll end up with an install in c:\cygwin
- When you get to the package selection screen, select at least: openssh, git, rxvt, patch, patchutils, telnet, unzip, nano, vim, rsync, wget, connect-proxy. Then let it download and install.
- Run "Rxvt Native" from the start menu. (If on Vista or later, you need to run it as administrator this time because we'll be setting up links in a privileged directory). The first time you do this it will install default profile files for you.
- In rxvt we'll now set up symbolic links to the Windows filesystem. Do this for each drive you have... I'm showing the C: and D: drives here:
cd /
ln -s /cygdrive/c
ln -s /cygdrive/d - Now you can navigate into the Windows filesystem to wherever your Drupal install is. /c is the root of the C: drive; /d is the root of the D: drive. For example, if you have Acquia's DAMP installed, it might be in /c/Users/rfay/Documents/Sites/acquia-drupal or something like that.
- Using cvs, you could check out the Examples project, for example:
export CVSROOT=:pserver:anonymous@cvs.drupal.org:/cvs/drupal-contrib
cvs login (your password is 'anonymous')
cvs -z6 checkout -d examples-HEAD contributions/modules/examplesand now you have a HEAD version of Examples.
- Using git you could get Examples from git.drupalfr.org:
git clone git://git.drupalfr.org/git/contributions-new-date/examples.git
- Or apply a patch using patch.... or create a patch using git diff --no-prefix...
The world is your oyster. You have the easy-to-use editor nano if you want to edit within Cygwin, but you can just use the Windows editor of your choice as well.
You may also want to watch the Lullabot video on installing Cygwin, which is old, but still useful and valid.
Edit: You can now use drush successfully on Windows! See Installing Drush on Windows Using Cygwin.
15 Comments
Cygwin + Drush
Submitted by Wim Mostrey on
One other great use I can imagine for Cygwin is Drush. There appear to be a couple of issues to get Drush (and Drush 3 specifically) running with Cygwin though. I think a lot of people would appreciate a follow-up article on Cygwun + Drush. It looks like it hasn't been done before.
Drush 3 + Cygwin
Submitted by rocksoup on
I set up Cygwin with Drush 3 today using this: http://drupal.org/node/594744 and a similar approach to the method above. Drush 3 on window$ ftw!
Drush + Windows
Submitted by greg.1.anderson on
Drush + Windows has definitely been done, but there are a few issues. I just committed a Windows-related fix to drush-HEAD; we could definitely use some good Windows hands in the drush queue to suggest and test patches.
Thanks for the great cygwin article.
Mintty
Submitted by David Corbacho on
I personally recommend to grab in the package selection "mintty". It's an alternative interface over Cygwin that makes everything nicer visually and more natural behaviors for Windows-users like selection of text, Right Click -> Copy, windows resizable, Drag&drop etc
Also can be grabbed as a standalone program http://code.google.com/p/mintty/
Also, unlike rxvt it supports
Submitted by Andy on
Also, unlike rxvt it supports Unicode (i.e. UTF-8), which is the default in latest Cygwin.
andLinux
Submitted by mikeytown2 on
I'm a huge fan of andLinux
http://www.andlinux.org/
http://drupal.org/node/505974
Still now?
Submitted by Vacilando on
I am interested to know -- are you still using andLinux, mikeytown2, or have you moved to a more promising system?
Typing by hand?!
Submitted by smk-ka on
Are you serious ;) To get an Explorer context menu entry for directories instead, you
<
ul>
chere -i -t mintty -e "&Bash Here"
The -e option allows you to change the text to be shown in the context menu to your likings.
I wish the windows keyboard
Submitted by AaronELBorg on
I wish the windows keyboard shortcuts stuff was more reliable. It works......occasionally.
I hate having to grab the mouse and click on an icon to simply open up a gd shell.
What's the key here??
had to also specify the --binary option with patch
Submitted by blainelang on
Randy, I found your article looking for a solution to errors I was getting trying to apply a patch using Cygwin:
Using the --binary option solved this for me.
as in:
$ patch -p0 --binary < /cygdrive/f/depot/patches/filedepot-use_url_for_links.patch
Cygwin with Linux line endings?
Submitted by rfay on
I suspect you may have installed cygwin not taking the default line ending setup (which is to use Unix/Linux line endings) and instead using Windows line endings. I haven't had this problem patching in cygwin myself. But since Cygwin is really a Linux environment, it's important to use the Unix/Linux-style line endings when doing cygwin.
Symbolic links incompatible with drush
Submitted by Vacilando on
The symbolic linking mentioned in the article (e.g.
ln -s /cygdrive/c
) has a problem with drush. I've installed drush 5 with WAMP today easily thanks to http://drupal.org/node/594744 but simple downloads such asdrush dl devel
were being installed in a Windows folder of the same name as the symbolic link.E.g. on site "/c/www" (folder "www" on C drive) the above drush command created a folder "c" on C drive.
Solution: avoid the symbolic links and simply run drush on the default cygwin path, e.g. "/cygwin/c/www".
I meant: avoid the symbolic
Submitted by Vacilando on
I meant: avoid the symbolic links and simply run drush on the default cygwin path, e.g. "/cygdrive/c/www"!
Update for Drush 5 and Windows 7
Submitted by Peter Cossey on
Hey Randy your article really helped me setup Drush on a Windows 7 machine, I created a page for the Drupal Community Docs here: http://drupal.org/node/1432756
As usual you make it look easy!
Added to the article
Submitted by rfay on
Thanks so much. I added the link to the article. Thanks for pioneering and documenting this great work.