在GNU/Linux上,有没有一种使用符号链接而不是硬链接从源代码构建Git的方法?
例如:
./configure
make
make install收益:
$PREFIX/bin/git
$PREFIX/libexec/git-core/git-log
$PREFIX/libexec/git-core/git-status
$PREFIX/libexec/git-core/git-commit
...都是硬链接。
我希望git-log,git-status,git-commit成为git的符号链接,等等。
发布于 2015-01-06 12:16:01
这样做是没有办法的。Makefile总是尝试首先创建硬链接,只有当它失败时,才返回到符号链接。
您可以尝试的是别名或阴影,在默认情况下创建符号链接。
发布于 2015-01-07 23:24:07
你能做到的除非我误会了。您要做的就是将NO_INSTALL_HARDLINKS=YesPlease添加到make行:
./configure
make NO_INSTALL_HARDLINKS=YesPlease
make NO_INSTALL_HARDLINKS=YesPlease install如果在Git源目录中的makefile顶部读取注释,您会发现:
# Define NO_INSTALL_HARDLINKS if you prefer to use either symbolic links or
# copies to install built-in git commands e.g. git-cat-file.请记住,Git只是部分地使用autoconf。它的大部分配置只能通过在命令行中添加make选项来选择:读取Makefile顶部的docs,以了解您可以做的其他事情。
不管怎么说,这对我有用。
发布于 2017-05-11 11:58:05
我可以确认MadScientist的方法仍然适用于最新的git版本。
wget https://www.kernel.org/pub/software/scm/git/git-2.12.3.tar.gz
./configure --prefix=/usr
make NO_INSTALL_HARDLINKS=YesPlease -j5
make NO_INSTALL_HARDLINKS=YesPlease install
ls -althr /usr/libexec/git-core
-rwxr-xr-x 1 root root 11M May 11 13:48 git
lrwxrwxrwx 1 root root 3 May 11 13:48 git-am -> githttps://stackoverflow.com/questions/27798181
复制相似问题