在 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
Locate Git installation folder on Mac OS X
提问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 git
in 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 git
in 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/git
it 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/git
and /etc/manpaths.d/git
items).
主要在/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 git
and 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