Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

zoliky

macrumors newbie
Original poster
Jun 8, 2009
22
0
Hello,
I use OS X 10.9 Mavericks. I already have git installed, but I didn't install it from the official website. I suppose it comes with XCODE.

Code:
$ whereis git
/usr/bin/git

$ git --version
git version 1.8.3.4 (Apple Git-47)

The latest git is 1.8.4.3. I would like to download the OS X installer from the official git website, but I would like your suggestions.

Do I need to uninstall the current git? What is the best way to update to 1.8.4.3?

Thank you!
 
You can easily compile your own git from the official sources. I do that all the time. If you change your $PATH to point to /usr/local/bin first, and compile git with prefix=/usr/local then it won't collide with apple's git.
 
You can easily compile your own git from the official sources. I do that all the time. If you change your $PATH to point to /usr/local/bin first, and compile git with prefix=/usr/local then it won't collide with apple's git.

If you compile from sources, how do you update it when a new version comes out?
 
I downloaded from the website and installed it. No problems. I've now moved on to macports as it is easier to keep it up to date. Also works fine but I've set /opt/local/bin before /usr/bin in my $PATH in order to use the macports version by default. However, I wonder if I still need to do this as I'm not using the very advanced features in git. The system installed one (aka the one that came with Xcode) seems fine for my uses.
 
Git gains quite a few nice features, but unless you're reading changelogs you won't know about them anyway, so upgrading bleeding edge is not usually immediately useful.
 
Don't install homebrew. Its developer doesn't understand how UNIX works and thinks he can own /usr/local completely which isn't true at all. If you install something like gpgtools you will break it because homebrew will put a complete idiotic acl on it (it gives all users full access to /usr/local). Unfortunately, installing homebrew elsewhere usually results in homebrew not working correctly all the time. IIRC they won't even give you support if you installed it somewhere else. As long as these major issues are not resolved homebrew is not to be recommended!

Also, homebrew uses the existing libraries and such in OS X. This may sound very cool and useful and it is to some extend. There is also a major downside to this because you will have to put up with all the quirks of the OS X installed versions, outdated libraries, tools, etc. It also means that if you screw things up you need to reinstall the entire OS or restore from backup. There are others that don't have these disadvantages (they have others; none is perfect) and, for example, install in their own directory. If something goes wrong you can delete it and start from scratch.

TL;DR: homebrew has some issues that may b0rk your system. Be sure to read up on what it does, how it works before you even decide to use it!
 
I downloaded from the website and installed it. No problems. I've now moved on to macports as it is easier to keep it up to date. Also works fine but I've set /opt/local/bin before /usr/bin in my $PATH in order to use the macports version by default. However, I wonder if I still need to do this as I'm not using the very advanced features in git. The system installed one (aka the one that came with Xcode) seems fine for my uses.

I would like to use macports too. How can I set $PATH? Do I need to edit a file?
 
You can do this manually and there are a few ways of doing that (mostly you set it in the shell config file: .bash_profile, .bashrc, .zshrc, etc.). If you use the Macports installer it will set this automatically though. Check out the Macports documentation for more details on this.
 
You can do this manually and there are a few ways of doing that (mostly you set it in the shell config file: .bash_profile, .bashrc, .zshrc, etc.). If you use the Macports installer it will set this automatically though. Check out the Macports documentation for more details on this.

What do the plus signs mean? [+]doc, [+]pcre
Are they already enabled by default?
 

Attachments

  • Screen Shot 2013-12-06 at 3.12.53 PM.png
    Screen Shot 2013-12-06 at 3.12.53 PM.png
    21.8 KB · Views: 160
Those are variants and they are not enabled by default. Macports and homebrew will download the source, configure it and then compile it. You can set various options and to keep things simple Macports uses this variants system. If you want to have git with only the documentation you'd enter the following:
Code:
sudo port install git-core +doc

It should also work the other way around. This helps if you do not want something like X11 (graphical environment). You could do something like this:
Code:
sudo port install wireshark -x11
. Alternatively you could use +nox11, it does the same thing. If you want to do this as default behaviour for any port you install you should set this in the file /opt/local/etc/macports/variants.conf (it has some examples in it).

Usually the defaults are fine. You only need to use variants when the default doesn't work because it lacks some feature. Things like documentation can be left out as most software will have it posted on the internet and you can search for it (you get examples from others and such).

Be sure to check out the Macport documentation regarding variants for more info and some examples: Port Variants.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.