Simon Engledew's Blog

Eldritch nomenclature, conjoured for arcane contraptions to execute unerringly.

September 2, 2009 at 9:50pm
home

Reinstalling git on Snow Leopard

If you are reinstalling git for Snow Leopard, don’t forget to nuke MacPorts. Leaving an old version on your machine will cause the git compile process to spit out various incorrect architecture errors:

ld: warning: in /opt/local/lib/libz.dylib, file is not of required architecture
ld: warning: in /opt/local/lib/libiconv.dylib, file is not of required architecture

Remove MacPorts with the terrifyingly brutal:

sudo rm -rf \
    /opt/local \
    /etc/manpaths.d/macports \
    /etc/paths.d/macports \
    /Applications/DarwinPorts \
    /Applications/MacPorts \
    /Library/LaunchDaemons/org.macports.* \
    /Library/Receipts/DarwinPorts*.pkg \
    /Library/Receipts/MacPorts*.pkg \
    /Library/StartupItems/DarwinPortsStartup \
    /Library/Tcl/darwinports1.0 \
    /Library/Tcl/macports1.0

Once you have removed MacPorts, the compile process should be as easy as:

make configure 
./configure --prefix=/usr/local
make prefix=/usr/local all
sudo make prefix=/usr/local install

git config --global user.name "[user.name]" 
git config --global user.email "[user.email]"

And when you are done, don’t forget this little gem for adding pretty colours to your git output:

git config --global color.ui "auto"