[git] Locate Git installation folder on Mac OS X

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

This question is related to git macos

The answer is


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


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


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

whereis git

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


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.


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


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


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.


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


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


On Mojave

The binary is in

/usr/bin/git

The related scripts are here

/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git

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


Examples related to git

Does the target directory for a git clone have to match the repo name? Git fatal: protocol 'https' is not supported Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) git clone: Authentication failed for <URL> destination path already exists and is not an empty directory SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 GitLab remote: HTTP Basic: Access denied and fatal Authentication How can I switch to another branch in git? VS 2017 Git Local Commit DB.lock error on every commit How to remove an unpushed outgoing commit in Visual Studio?

Examples related to macos

Problems with installation of Google App Engine SDK for php in OS X dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib error running php after installing node with brew on Mac Could not install packages due to an EnvironmentError: [Errno 13] How do I install Java on Mac OSX allowing version switching? Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) Can't compile C program on a Mac after upgrade to Mojave You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory. (mac user) How can I install a previous version of Python 3 in macOS using homebrew? Could not install packages due to a "Environment error :[error 13]: permission denied : 'usr/local/bin/f2py'"