139

I'm just curious, Where Git get installed (via DMG) on Mac OS X file system?

Chiron
  • 20,081
  • 17
  • 81
  • 133

11 Answers11

222

Is it in your PATH? If so just run which git in the terminal and it will tell you.

scottd
  • 7,364
  • 1
  • 24
  • 27
137

The installer from the git homepage installs into /usr/local/git by default. See also this answer. However, if you install XCode4, it will install a git version in /usr/bin. To ensure you can easily upgrade from the website and use the latest git version, edit either your profile information to place /usr/local/git/bin before /usr/bin in the $PATH or edit /etc/paths and insert /usr/local/git/bin as the first entry (see this answer).

Community
  • 1
  • 1
BHMulder
  • 1,444
  • 1
  • 11
  • 5
  • 1
    I first installed git 1.8 via dmg, but then installed the Command Line Tools for XCode (not the full XCode4) from Apple which installed 1.7. Placing /usr/local/git/bin in the front of my path got me using 1.8 again. Thanks! – emkman Jan 05 '13 at 07:10
  • Cool, it worked for me too on 10.8.4, had the old version and new installation was not reflecting, changing order in /etc/paths works. – Mohammad Arif Jun 25 '13 at 03:46
55

simply type in which git in your terminal window and it will show you exactly where it was installed.

Ray Fitzgerald
  • 740
  • 6
  • 9
22

you can simply use this command on a terminal to find out git on unix platforms (mac/linux) -

whereis git or which git

This command should return something like - /usr/bin/git or any other location where git is installed

sahilabrar
  • 638
  • 1
  • 8
  • 15
8

On most of UNIX based sys, its at /usr/bin/git (if installed with default options)
all git related scripts are at /usr/libexec/git-core

theSTIG
  • 159
  • 1
  • 6
6

You can also try with /usr/local/bin/git it worked for me

Gastón Saillén
  • 12,319
  • 5
  • 67
  • 77
4

Usually some of the applications have been known to take it from the Xcode.app path also: /Applications/Xcode.app/Contents/Developer/usr/bin/

Coda 2, prefers this path than the soft link at /usr/bin.

gagneet
  • 35,729
  • 29
  • 78
  • 113
2

Mostly in /usr/local/git (there are also /etc/paths.d/git and /etc/manpaths.d/git items).

Amber
  • 507,862
  • 82
  • 626
  • 550
2

On Linux the command is whereis. Alternatively you can issue find / -name git and wait for an eternity. Alternatively try echo $PATH | sed "s/:/ /g" | xargs -L 1 ls | grep git

Novikov
  • 4,399
  • 3
  • 28
  • 36
0

If you have fresh installation / update of Xcode, it is possible that your git binary can't be executed (I had mine under /usr/bin/git). To fix this problem just run the Xcode and "Accept" license conditions and try again, it should work.

Matej P.
  • 5,303
  • 1
  • 28
  • 44
0

On Mojave

The binary is in

/usr/bin/git

The related scripts are here

/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git
Mark Irvin
  • 830
  • 1
  • 6
  • 16