我怎样才能让git遵循符号链接? [英] How can I get git to follow symlinks?
问题描述
我已经有了一个谷歌了解如何做到这一点,但没有任何运气。
我最好是将脚本替换为符号链接复制,还是有另一种告诉git遵循符号链接的方法?
PS:我知道这不是很安全,但我只想在几个特定情况下。 c> git 1.6.1 。 Git默认尝试存储符号链接而不是遵循这些符号链接()。 但是,当符号链接是一个目录时,我意外地设法让它在符号链接之外添加文件。
$ b 即:
/ foo /
/ foo / baz
/ bar / foo - > / foo
/ bar / foo / baz
b
git add / bar / foo / baz
它在我尝试时似乎有效,但当时我的行为不受欢迎,所以除此之外,我无法向您提供信息。
I've had a google for how to do this, but not had any luck.
Is my best be going to be a shell script which replaces symlinks with copies, or is there another way of telling git to follow symlinks?
PS: I know it's not very secure, but I only want to do it in a few specific cases.
NOTE: This advice is now out-dated as per comment since git 1.6.1
. Git used to behave this way, and no longer does.
Git by default attempts to store symlinks instead of following them ( for compactness, and it's generally what people want )
However, I accidentally managed to get it to add files beyond the symlink when the symlink is a directory.
i.e.:
/foo/
/foo/baz
/bar/foo --> /foo
/bar/foo/baz
by doing
git add /bar/foo/baz
it appeared to work when I tried it, that behavior was however unwanted by me at the time, so I can't give you info beyond that.
这篇关于我怎样才能让git遵循符号链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!