gpt4 book ai didi

linux - 带有硬链接(hard link)的svn

转载 作者:可可西里 更新时间:2023-11-01 11:50:01 30 4
gpt4 key购买 nike

我在 Ubuntu 上使用 Apache Subversion (SVN)。我有一个在几个子项目中使用的文件。所以我使用指向同一个文件的硬链接(hard link)。

svn commit后,硬链接(hard link)似乎变成了独立的文件(链接数变成1)。

SVN可以保留硬链接(hard link)吗?

最佳答案

Subversion 从 1.1 (2004) 开始支持符号链接(symbolic link)。

硬链接(hard link)不会像普通文件一样被识别和处理。

另见 Version Control with Subversion

Versioning Symbolic Links

On non-Windows platforms, Subversion is able to version files of the special type symbolic link (or “symlink”). A symlink is a file that acts as a sort of transparent reference to some other object in the filesystem, allowing programs to read and write to those objects indirectly by performing operations on the symlink itself.

When a symlink is committed into a Subversion repository, Subversion remembers that the file was in fact a symlink, as well as the object to which the symlink “points.” When that symlink is checked out to another working copy on a non-Windows system, Subversion reconstructs a real filesystem-level symbolic link from the versioned symlink. But that doesn't in any way limit the usability of working copies on systems such as Windows that do not support symlinks. On such systems, Subversion simply creates a regular text file whose contents are the path to which the original symlink pointed. While that file can't be used as a symlink on a Windows system, it also won't prevent Windows users from performing their other Subversion-related activities.

关于linux - 带有硬链接(hard link)的svn,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12456501/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com