【发布时间】:2013-08-13 19:28:27
【问题描述】:
我能够将我的目录添加到 git 并执行 git commit 但奇怪的是,当我这样做时
$ git add .
我收到以下错误:
warning: LF will be replaced by CRLF in .idea/workspace.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in grails-app/controllers/com/abc/pqr/Rep
ortController.groovy.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in grails-app/domain/com/abc/pqr/Report.g
roovy.
The file will have its original line endings in your working directory.
fatal: unable to stat 'Dirname#com.abc.pqr.Report': No such file or directo
ry
我已经通过this SO 回答,如果我尝试:
$ git rm Dirname#com.abc.pqr.Report
我收到此错误:
fatal: pathspec 'Dirname#com.abc.pqr.Report' did not match any files
令人惊讶的是,在搜索上述目录时没有文件,我没有找到上述任何此类文件。
值得一提的是,根目录下有一个文件Dirname/#com.abc.pqr.Report(即根目录下Dirname下的文件#com.abc.pqr.Report)。奇怪的是我无法删除,一个类似于this(我使用的是windows-7 os)的问题,我可以使用this解决它。但是自从我(不小心通过一个错误的grails脚本)创建了上面文件,我无法执行 `git add 。
【问题讨论】:
-
Dirname#com.abc.pqr.Report是悬空链接吗?向我们提供有关该文件的更多详细信息。 -
@GregBacon 什么是“悬空符号链接”?
-
@GregBacon 根据我对“悬空符号链接”和 ubuntuforums.org/showthread.php?t=1078729 的理解,是的,它似乎是一个。但是我在 Windows 上使用它,但 git bash 似乎是基于 linux 的。
-
ls -l 'Dirname#com.abc.pqr.Report'的输出是什么? -
@GregBacon 没有这样的文件或目录
标签: git filesystems git-add