让git遵循符号链接(再次) [英] Getting git to follow symlinks (again)

查看:473
本文介绍了让git遵循符号链接(再次)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人已经问过你如何让git遵循符号链接。有一个符号链接的目录的答案,但不是符号链接的文件。这也是一年前。

问题:你如何让git遵循一个符号链接并添加它引用的文件?



以下是旧问题:我该如何让git遵循符号链接?。还有一个关于git通常会做什么的问题如何git是否处理符号链接?。我改变了这种行为。



如果你关心:我在unix上运行git 1.5.4.3,在mac上运行git 1.6.0。

解决方案

我很确定没有办法。另外,这听起来像是一种不安全的,未定义的行为 - 当你在文件的版本之间移动并且需要写入文件时它应该做什么?特别是,如果您在添加之前签出修订版,您是否真的希望它删除存储库以外的文件内容?如果你回到现在并重新创建文件,或者如果修改了符号链接本身 - git是否也会跟踪符号链接本身,会发生什么?



沿着这些线条的东西是< 在git邮件列表上在去年年底回应了基本相同的问题。


Somebody already asked how you can get git to follow symlinks. There was an answer for a symlinked directory, but not for a symlinked file. It was also over a year ago.

Question: how do you get git to follow a symlink and add the file it refers to?

Here is the old question: How can I get git to follow symlinks?. There's also a question about what git typically does How does git handle symbolic links?. I'm after a way of changing this behaviour.

In case you care: I'm running git 1.5.4.3 on unix and git version 1.6.0 on mac.

解决方案

I'm pretty sure there's no way.

Additionally, it sounds like a kind of insecure, undefined behavior - what should it do when you move between versions of the file and it needs to write to it? In particular, if you check out a revision before it was added, do you really want it to remove the contents of a file outside the repository? What happens if you come back to present and recreate the file, or if the symlink itself is modified - should git also track the symlink itself?

Things along these lines were said on the git mailing list late last year in response to essentially the same question.

这篇关于让git遵循符号链接(再次)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆