MIT
MIT
CBA
CBA
FabCentral FabClass [fall 2007] People Steve GIK
git from cygwin
You Are Here


Making git work properly from cygwin

This page describes what I had to do in order to get my git installation (when running in cygwin on windows) to play nicely with the fab server.



Install git

Use the standard cygwin setup tool to add git to your system (it exists under the "devel" packages).

Check out a copy of the fab repository

Substitute the correct number for <PORT>and the correct path for <REPOSITORY_DIR> below

mkdir ~/.ssh

Create file named ~/.ssh/config, and make it contain:
Hostname fab.cba.mit.edu
Port <PORT>


chmod 700 ~/.ssh/config

git clone fabclass@fab.cba.mit.edu :<REPOSITORY_DIR>

Make local changes as necessary

Attempt to do git commit

git commit -m "some message"

In my case, I had made changes in Dreamweaver, which saved files with windows-style CRLFs instead of civilized newlines. This caused git commit to refuse to do the commit, and it printed out a whole bunch of output, prefaced by the statement: "You have some suspicious patch lines".

The fix

To fix it, I had to modify the perl script <GIT_DIR>/.git/hooks/pre-commit (where <GIT_DIR> is the top level of the copy of the repository on my local machine) , and comment out the following lines:

if (/\s$/) {
bad_line("trailing whitespace", $_);
}

like so:

# if (/\s$/) {
# bad_line("trailing whitespace", $_);
# }

This fix was copied from information on: http://www.dont-panic.cc/capi/tag/git/

After doing this, my git commit command worked, and I was able to do git push.