After a bit of trial and error, I’ve managed to get git running on my Windows box under Cygwin, on my Macbook Pro using the latest MacPorts, and on a remote repository located on NearlyFreeSpeech.net. I’m pretty much a git newb, so what follows may only be interesting to other git newbies.
I was able to get Bash completion working with git by using the instructions I found here. Bash completion is really nice, especially when typing out branch names.
I’m not currently using any GUIs (although I downloaded GitX on my Mac to look at branches), preferring to immerse myself in the command line in hopes of increasing my understanding of how git works. So far, the experience has been pretty positive. I’m still just doing basic stuff, and my only branch usage has been to create one-off development branches to hack out a feature. I’ve been deleting them after I merge back to master.
I have ran into a few issues. Moves aren’t has carefree was I was led to believe. Simple moves without file modifications are pretty transparent to git, but it doesn’t like it when you move and significantly edit a file. Instead of a nice rename in git status like this:
[text highlight=”6″]
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>…" to unstage)
#
# renamed: bar.py -> foo/bar.py
#
[/text]
You get something more frustrating, like this:
[text highlight=”6,12″]
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>…" to unstage)
#
# new file: foo/bar.py
#
# Changed but not updated:
# (use "git add/rm <file>…" to update what will be committed)
# (use "git checkout — <file>…" to discard changes in working directory)
#
# deleted: bar.py
#
[/text]
This is a bit of a drag. When refactoring, I don’t think of where I’m going to move files first, then edit them. Its all one flow. With subversion, I could always go to the repository and specifically tell svn that a new file and an missing file are the same. With git, I ended up archiving my changes, restoring my working folder, committing the moves, then copying the updated files from my archive. It may take awhile for me to start thinking in terms of move, edit, then commit in order to avoid this kind of problem.
I ran into a odd issue with test file permissions getting set to executable. I suspect the issue is related to git on Cygwin. Cygwin on an NTFS drive apparently assumes the file mode of new files is +x. I’ve temporarily worked around the issue by configuring git on Cygwin to ignore file modes.
[text]
git config core.filemode false
[/text]