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 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

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

  • hdiutil attach git-


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\


3a. Unmount the dmg

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


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


Done =)


9 thoughts on “Mac – Git installation on OSX”

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


    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


      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 script in it but I don’t know how to cd into it in terminal.

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


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


      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.


      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


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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