Kristjan Jansen , interaction designer. I teach, talk and have a podcast. Here is my portfolio & CV. Find me in Twitter, Facebook, LinkedIn, Github, Instagram & Gmail.

This guide is compiled for Drupal Estonia Hackday where I held a workshop on Drupal development under Windows. For a long-time OSX user it struck me that creating a fully working development environment under Windows is not that hard at all.

Note that this guide only deals with command line and code editing experience, it does not help to set up LAMP stack for Drupal.

Getting started

  1. Install Git
  2. Install Sublime Text
  3. Install Console…est/download. Note that you will need to unpack, copy "Console2" dir to to "C:\Program Files (x86)" and create shortcut icon yourself.
  4. Install Drush…ws_installer

What about Github for Windows?

Freshly baked eases some of the pain of setting up Git on Windows and also includes full Git command line client but it's best for developing for Github only. Non-Github remote repositories are supported, but they are a bit buggy, at least in initial version. At the time of writing only cloning works nicely, building local repo and assigning remote is not properly recognized and need extra steps. Also, re-using Github SSH keys requires command line knowledge and autogenerated dotfiles (.gitignore etc) might bring confusion for newcomers. Still this pretty Github application might bring a lot of potential in the future, especially for visual merging etc.

Setting command line alias for Sublime Text

  1. Run "Git Bash"
  2. Enter following commands:
echo 'alias sub="/c/Program\ Files/Sublime\ Text\ 2/sublime_text.exe"' >> ~/.profile
source ~/.profile

Now you can enter sub . in any directory in the command line to run Sublime Text.

Also, you might want to configure Sublime Text to more predictable startup experience. Go to Preferences -> Settings – User and adjust following settings to false:

"hot_exit": false
"remember_open_files": false

Setting Git default editor to Sublime Text

To save you from thrown into Vim when commiting without -m option it's wise to set Git to throw you to Sublime Text instead.

git config --global core.editor "'C:/Program Files/Sublime Text 2/sublime_text.exe'"

Set up Console to run Git shell

  1. Run Console
  2. Go to "Edit -> Settings"
  3. Fill "Shell" field with
C:\Windows\SysWOW64\cmd.exe /c ""C:\Program Files (x86)\Git\bin\sh.exe" --login -i"
  1. Fill "Startup dir" field with your working directory, usually something like C:\Users\your_username\your_working_directory

See also…into-console

Set up Git config

git config --global "my fullname goes here"
git config --global my_email_goes_here

Note that you must fill in my fullname goes here and my_email_goes_here. E-mail must match with e-mail you have used for registration in

There are many additional tricks to set up a more workable Git config, for examples see here:…

Generate SSH Keys

First, make sure you have account and you have applied for Git access in Drupal You also might want to have Github account

ssh-keygen -t rsa -C "my_email_goes_here"
sub ~/.ssh/

Note that you must to fill in my_email_goes_here. Actually, it does not have to be e-mail, it can be any string but using e-mail is a convention.

Upload SSH keys

Then copy all the contents of the ~/.ssh/ file to:

…to ->Version control -> Profile -> SSH Keys (help here).

…to Github: (help here).

Finally, lets started with Git

Creating new repo

mkdir test
cd test
git init
echo "About this project" > README.txt
git add .
git commit -m "Initial commit"

Push repo to Drupal

First create a new sandbox project in…ject-project. When done, navigate to Version control tab and run

git remote add origin
git push origin master

Note that you must to fill in your_drupalname and your_sandbox_id.

…or push repo to Github

Go to, ignore "Initialize this repository with a README" setting.

git remote add origin
git push origin master

Note that you must to fill in your_username and your_projectname.

Git and Drupal development

Apply a patch with three lines

git clone <a href="" title=""></a>
cd drupal
curl link_to_the_patch | git apply

Note that you must to fill in link_to_the_patch with actual URL

Roll back in one line:

git reset --hard

Create a patch for Drupal:

There is comprehensive manual for creating Drupal patches…instructions but in most simple form it goes like this:

git clone <a href="" title=""></a>
cd drupal
sub .
...edit something and save...
git diff

This gives you a overview what you have changed. To save patch to a file, run:

git diff > ~/my_patches_dir/my_patch_name.patch

More info about Git…eview/135990…t_screencast