在 Mac OS X 上找到 Git 安装文件夹

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3623739/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 09:00:59  来源:igfitidea点击:

Locate Git installation folder on Mac OS X

gitmacos

提问by Chiron

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

我只是好奇,在 Mac OS X 文件系统上哪里安装 Git(通过 DMG)?

回答by scottd

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

它在你的路径中吗?如果是这样,只需which git在终端中运行,它就会告诉你。

回答by BHMulder

The installer from the git homepageinstalls into /usr/local/gitby 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/binbefore /usr/binin the $PATHor edit /etc/pathsand insert /usr/local/git/binas the first entry (see this answer).

来自git 主页的安装程序默认安装到/usr/local/git 中。另请参阅此答案。但是,如果您安装 XCode4,它将在/usr/bin 中安装一个 git 版本。为确保您可以轻松地从网站升级并使用最新的 git 版本,请编辑您的配置文件信息以将/usr/local/git /bin放在$PATH中的/usr/bin之前,或者编辑/etc/paths并插入/usr /local/git/bin作为第一个条目(请参阅此答案)。

回答by Ray Fitzgerald

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

只需在which git终端窗口中输入,它就会显示它的确切安装位置。

回答by theSTIG

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

在大多数基于 UNIX 的系统上,它在/usr/bin/git(如果使用默认选项安装)
所有与 git 相关的脚本都在/usr/libexec/git-core

回答by Gastón Saillén

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

你也可以试试/usr/local/bin/git它对我有用

回答by gagneet

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

通常已知一些应用程序也会从 Xcode.app 路径中获取它:/Applications/Xcode.app/Contents/Developer/usr/bin/

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

Coda 2,比 /usr/bin 的软链接更喜欢这个路径。

回答by Amber

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

主要在/usr/local/git(也有/etc/paths.d/git/etc/manpaths.d/git项目)。

回答by Novikov

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

在 Linux 上,命令是 whereis。或者,您可以发出find / -name git并等待永恒。或者尝试echo $PATH | sed "s/:/ /g" | xargs -L 1 ls | grep git

回答by sahilabrar

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

你可以简单地在终端上使用这个命令来找出 unix 平台 (mac/linux) 上的 git -

whereis git

whereis git

This command should return something like - /usr/bin/git

此命令应返回类似 - /usr/bin/git 的内容

回答by Mark Irvin

On Mojave

在莫哈韦沙漠

The binary is in

二进制文件在

/usr/bin/git

The related scripts are here

相关脚本在这里

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