Mac – Git installation on OSX

I am working on a new Drupal 7 module which is called BeansTag and hopefully it could be submitted to drupal.org soon. But before i could submit it, i have to make the Git work in my Mac OSX.

Here are the steps for Git installation in Mac OSX
1. Download the dmg from http://code.google.com/p/git-osx-installer/
 

1a. Mount the dmg with the following command (Thanks Shahriar)

  • hdiutil attach git-1.7.5.4-i386-leopard.dmg

 

2. Open the dmg and run the installer

 

3. Go to the mounted dmg folder in terminal and run the .sh shell script

  • ./setup\ git\ PATH\ for\ non-terminal\ programs.sh


 

3a. Unmount the dmg

  • hdiutil detach /Volumes/Git\ 1.7.5.4\ i386\ Leopard/

 

4. Open another terminal and now your git command is ready to use

 

Done =)

Reference:

9 thoughts on “Mac – Git installation on OSX”

  1. After step 2 you need to mount the .dmg
    Use this command
    $hdiutil attach git-1.7.5.4-i386-leopard.dmg
    it will mount the dmg in /Volumes/Git 1.7.5.4 i386 Leopard
    now follow step3
    after finished step3 unmount with this command
    $hdiutil detach /Volumes/Git\ 1.7.5.4\ i386\ Leopard/

    Like

    1. when i installed it, i didn’t need to mount the dmg by command. anyway, i have updated the post. Thanks for your suggestion. =D

      Like

      1. Actually I found it not very useful for me. I’ve already get it setup, and I want to uninstall it. There’re a uninstall.sh script in it but I don’t know how to cd into it in terminal.

        Now I’ve figured it out.
        cd /Volume/G
        ./uni
        🙂

        thx

        I’m interested in the command “attach”. I didn’t have it in my terminal. Where can I get it?

        Like

      2. git on OSX, there is a better way.

        use the command line tools of XCode provided officially. It has gcc, make and many other Unix-like commands.

        It’s on the apple developer website. Have to log on it with a free apple id.

        Like

      3. O, i think i made a mistake. there is not such a command called “attach”, it should be “hdiutil attach”.

        sorry for the misleading

        Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.