【发布时间】:2022-01-02 03:02:48
【问题描述】:
我有一个名为“adm.php”的文件。 我想将它转移到我的存储库,但我总是收到以下错误消息:
git
-c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks add -f --
adm.php
error: open("adm.php"): Invalid argument
error: unable to index file 'adm.php'
fatal: adding files failed
Completed with errors, see above.
我在 Windows 11 上使用 Sourcetree。
重命名文件会很困难,否则我必须调整一些文件...
是否有可能在 Git 配置中定义异常或其他可能性?
提前致谢!
【问题讨论】:
-
如果您尝试使用命令行手动添加它会发生什么?
git add adm.php? -
同样的错误 =(
$ git add adm.php error: open("adm.php"): Invalid argument error: unable to index file 'adm.php' fatal: adding files failed -
这个
error: open("adm.php"):看起来你有一个预提交钩子?它在做什么? -
说实话,我自己也不太明白。我只有一个标准的 Git 安装,没有额外的东西。我使用 Windows 11 并通过程序 Sourcetree 管理 Git。我唯一猜测的是它与文件名有关。显然,文件名“adm”对于 Windows 或 Git 来说都是一个问题,这完全是愚蠢的......
-
嗯....我发现了问题.... Windows 本身....它将文件标记为“病毒”,这完全没有意义,当然也不会通知我。 ..
标签: windows git atlassian-sourcetree staging