Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用符号链接构建Git_Git_Gnu Make_Configure - Fatal编程技术网

使用符号链接构建Git

使用符号链接构建Git,git,gnu-make,configure,Git,Gnu Make,Configure,在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日志,git状态,git提交成为指向git等的符号链接。没有内

在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日志
git状态
git提交
成为指向
git
等的符号链接。

没有内置的方法来实现这一点。始终首先尝试创建硬链接,只有在失败时,才会退回到符号链接


您可以尝试使用别名或阴影ln来默认创建符号链接。

没有内置的方法来完成此操作。始终首先尝试创建硬链接,只有在失败时,才会退回到符号链接

您可以尝试使用别名或阴影ln来默认创建符号链接。

您可以这样做,除非我有误解。您只需将
NO\u INSTALL\u HARDLINKS=YesPlease
添加到生成行:

./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顶部的文档,了解您可以执行的其他操作

不管怎么说,这对我很有效。

你可以这样做,除非我有误解。您只需将
NO\u INSTALL\u HARDLINKS=YesPlease
添加到生成行:

./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顶部的文档,了解您可以执行的其他操作


无论如何,它对我来说是有效的。

我可以确认,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 -> git

我可以确认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 -> git

谢谢你的回复和建议,我会遵循。谢谢你的回复和建议,我会遵循。