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:

About these ads

9 thoughts on “Mac – Git installation on OSX

  1. Shahriar

    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/

    Reply
    1. ykyuen Post author

      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

      Reply
  2. oliver

    Hi where can I get the command “attach”? I’m using Mountain Lion and don’t have one.

    thanks.

    Reply
      1. oliver

        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?

      2. oliver

        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. ykyuen Post author

        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:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s