I'm a Windows/Linux guy that just got my Macbook Air. I do web dev, and am currently trying to setup this machine for some on-the-go development.

After some research attempts, I'm wondering: what's the best way to install command line utilities in Lion, such as GIT? Best as in easiest to install, maintain, upgrade etc.

As I understand it, there are some alternatives: macports, homebrew etc. Or in the GIT example, maybe just download the installer from their website.



I think it depends on how many tools/libraries you need to install.

If just git then use Xcode 4 which you will need for any port package. If you are doing pure HTML/Javascripy/CSS then the git installer will work.

For python and perl and similar interpreters the the language install tools can be used unless there are complex C/C++ libraries

If only a few others then build into /usr/local

However if you have several things to install or there are complex dependencies then I would use a ports package like Fink, macports or homebrew (which is best is debatable and should be a separate discussion)

  • To answer your follow up: I will also need to install apache, php, mysql, node.js, maybe python etc. Xcode's 3 GB foot print seams a little rough, since I currently only would need it for GIT. – Znarkus Aug 4 '11 at 21:47
  • Given this question for python and mysql stackoverflow.com/questions/1448429/… - I suspect you will need a ports system and they require Xcode – mmmmmm Aug 5 '11 at 7:57
  • Alright, thanks. I've installed brew now, so will try if it is sufficient, otherwise I'll check out macports. – Znarkus Aug 5 '11 at 8:19

If it's just git then, by all means, their installation procedure works well. But you know it won't stay like that.

I really prefer homebrew over macports. I brew everyday =) It's super easy to install: https://github.com/mxcl/homebrew/wiki/installation And it hasn't bitten me yet. Their non-sudo approach rocks. Maybe there aren't always formulas for everything, but I most often take that as a hint. =)

  • Thanks. Any specific reason you prefer homebrew? – Znarkus Aug 4 '11 at 21:51
  • 2
    I find it much less prone to end up in a dependency mess than macports. With Macports I often found myself with a broken package which could steal hours from time I didn't have. I'm sure it depended a lot on me, but homebrew just treats me nicer. It's super fast too. – PEZ Aug 4 '11 at 21:58
  • With macports and fink everything is not in /usr/local so is sandboxed away from the standard compilers so is more repeatable (and I have not found many broken packages and with Unix security it is better to install as a different user to yourself) - note this is why I suggest macports vs fink vs homebrew discussions are not really part of the answer to this question – mmmmmm Aug 5 '11 at 8:00

Git's bundled with the free version of Xcode 4 on the app store. That's about as easy and official as it gets in my book. You won't do wrong by choosing homebrew as it's solid and got great momentum plus mindshare presently.

  • Thanks. The 3 GB foot print of Xcode is a little daunting, since I currently only would need it for GIT. Do you know if there are any other CLI tools bundled with Xcode? – Znarkus Aug 4 '11 at 21:57
  • clang, llvm, and tons of other tools (but no db nor node.js). Start with homebrew and grab the Xcode next time you're in an Apple store or other place with a fast pipe and a USB drive in your pocket. – bmike Aug 4 '11 at 22:06

These are pretty easy to follow instructions, and they should still work.

  • Okay thanks, but those are very specific to Git as I understand it? Is there no common go-to solution, like aptitude on Ubuntu? – Znarkus Aug 4 '11 at 21:39
  • @Znarkus Not that I know of. – FossilizedCarlos Aug 5 '11 at 2:50
  • There is an equivalent to aptitude - it is macports or fink or homebrew - it is just not supplied by Apple – mmmmmm Aug 5 '11 at 8:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .