Installing git with MacPorts

The Good: MacPorts makes git, the new source version control system hotness, available to Mac users.

The Bad: MacPorts sometimes has attitude, and poops out trying to compile or install packages.

The Ugly: MacPorts doesn’t tell you how to fix it.

So here was what I saw:

mrm@whack:~$ port search git
cogito     devel/cogito   0.18.2   Git core and cogito tools to provide a fully-distributed SCM
git-core   devel/git-core 1.6.0.4  A fast version control system
qgit       devel/qgit     2.2      A graphical interface to git repositories
stgit      devel/stgit    0.14.3   Push/pop utility on top of GIT
cgit       www/cgit       0.8      A fast web interface for the git source code management system

Great. I’ll install git-core. What additional goodies are there?

mrm@whack:~$ port info git-core
git-core 1.6.0.4, devel/git-core (Variants: universal, doc, gitweb, svn, bash_completion)

http://git.or.cz/

Git is a fast, scalable, distributed open source version control system focusing on speed and efficiency.

Library Dependencies: curl, zlib, openssl, expat, libiconv
Runtime Dependencies: rsync, perl5.8, p5-error
Platforms: darwin
Maintainers: bryan@larsen.st maccheck@gmail.com openmaintainer@macports.org

OK, so I want svn and doc and bash_completion extras:

mrm@whack:~$ sudo port install git-core +svn +doc +bash_completion +gitweb
...
Error: Target org.macports.fetch returned: fetch failed
Error: The following dependencies failed to build: p5-svn-simple subversion-perlbindings subversion p5-term-readkey rsync popt
Error: Status 1 encountered during processing.

So we’re now at the bad and ugly. When ports cops attitude, run these two commands:

sudo port selfupdate
sudo port upgrade outdated

and wait. If there are any failures, look at the package that failed, and restart the installation of that package. Once that’s completed, re-do the original port install git ... command.

Related posts:

  1. Macports fails to compile p5-perlmagick
    If you need PerlMagick on a Mac, there was (and still is) a p5-perlmagick package. If you try to install that package now, you’ll find it doesn’t compile (!!). You......
  2. Apache2, PHP, and MySQL on Mac OS X using MacPorts
    1. Install MacPorts Follow the instructions here: http://www.macports.org/install.php. 2. Install apache2 sudo port install apache2 Note that the macports instructions suggest installing the launchctl script now, but we’ll do that......
  3. Quick MacPorts Installation of Ruby on Rails
    October 2010 update: I wrote this a while back, before I knew about RVM. The Ruby Version Manager has a bunch of features that makes it better than macports for......
  4. Ant bash completion on Mac OS X
    bash will do tab-completion for ant targets on Debian/Ubuntu boxes out-of-the-box. If you haven’t upgraded lately, you may need to: sudo apt-get install bash-completion On Mac OS X, it needs......

  • khsing

    maybe macport upgrade should be like this:

    port upgrade outdated

  • http://matthew.mceachen.us matthew

    Thanks, you’re right. I updated the post.