Git文件超出了符号链接 [英] Git file is beyond a symbolic link

查看:421
本文介绍了Git文件超出了符号链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个问题,其中Git认为文件超出了符号链接,因此无法对其进行版本控制,但它似乎是真实文件.

I've ran into an issue wherein Git believes that a file is beyond a symbolic link, and that, thus, it cannot be version controlled, but it appears to be a real file.

[root@r1 h]# stat -f conf/core-site.xml 
  File: "conf/core-site.xml"
    ID: 5c7eb82882a6e866 Namelen: 255     Type: ext2/ext3
Block size: 4096       Fundamental block size: 4096
Blocks: Total: 2735511    Free: 510158     Available: 371202
Inodes: Total: 694960     Free: 597972

此外,我尝试使用"readlink"显示链接指针,但无济于事.

Additionally, I've tried "readlink" to show the link pointer, but to no avail.

Git如何确定文件是否为符号链接?

How does Git determine if a file is a symbolic link or not?

推荐答案

/project/subproject/conf

/project/subproject/conf

如果您需要将/conf添加到主项目中并为子项目添加符号链接,

If you need to add the /conf into the main project and add symlinks for subprojects,

01)从子项目中删除conf并将其添加到项目中,然后提交更改.

01) Remove conf from subproject and add to the project, and commit changes.

  • cp/project/subproject/conf/project
  • rm/project/subproject/conf
  • 提交更改

02)然后添加符号链接并提交

02) Then add the symlink and commit

  • cd/project/subproject/
  • ln -s ../conf/conf
  • 提交更改

这篇关于Git文件超出了符号链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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