Corporate Git – Cygwin

July 26th, 2010

previoushomenext


Install cygwin. See cygwin.com. Follow the installation instructions. I recommend the following options:

  • Install from Internet
  • All Users
  • Use IE5 Settings
  • Select a mirror near you (if you can find out where they are!)
  • Unix style linefeeds (LF)

Make sure to Select Packages below (among others) besides the Base packages:

  • git (git-gui, gitk)
  • mintty
  • cygrunsrv
  • openssh

After installation let’s sort out the home folders. Cygwin 1.7.x uses it’s own user profiles in /home (C:\WhereeverYouInstalledCygwin\home). I don’t like that. I prefer Cygwin to use the original Windows user profiles. I sorted this by mounting “D:\Documents and Settings” to “/home”. Just a simple entry to “/etc/fstab”:

D:/Documents\040and\040Settings /home ntfs binary 0 0

Now let’s get a proper semi-transparent terminal window. The icon added by the Cygwin installer starts “C:\WhereeverYouInstalledCygwin\Cygwin.bat”. This opens an interactive login shell (bash) in an ugly Windows Command prompt. To fix this, right-click the “Cygwin Bash Shell” icon, Properties. Note the minus sign at the end!

Target:    C:\WhereeverYouInstalledCygwin\bin\mintty.exe -
Start in:  C:\WhereeverYouInstalledCygwin\bin

Last but not least, let’s set up a cosy and comfortable home environment.

$ cd ~
$ echo "export EDITOR=mcedit" > .profile  # for everybody else, it's vi
$ echo 'export HISTCONTROL="ignoredups"' >> .profile

If you’ve already installed Cygwin before creating user “git” (see previous chapter), you can export the Windows user list to Cygwin.

$ cp /etc/passwd /etc/passwd.old    # backup for safety
$ mkpasswd > /etc/passwd
Comments are closed.