简体   繁体   English

Git,Windows,Linux和NTFS:“索引文件打开失败”

[英]Git, Windows, Linux & NTFS: “index file open failed”

I created a git repo in Windows 7 on a NTFS partition and when opening it in Linux (Ubuntu 12 x64, dual-boot setup) I get the index file open failed error. 我在Windows 7中的NTFS分区上创建了一个git repo,在Linux中打开它(Ubuntu 12 x64,双启动安装)时,出现index file open failed错误。 How can I figure out what's wrong? 我如何找出问题所在? The partition is mounted read-write and I've never had any other problems. 该分区是读写安装的,我再也没有其他问题。 Does git store data in a different format Windows vs. Linux and I need to do either a clone or some conversion? git是否以Windows和Linux不同的格式存储数据,我是否需要克隆或进行某些转换? I'd really like to be able to work on the same repo in both OSs without cloning around... 我真的很希望能够在两个操作系统中都可以在同一个仓库中工作而无需克隆...

Clarification: I also get cat: index: Input/output error when running the command cat index in the .git dir, so it is a NTFS related problem... but I've never had it before untill using git in a cross-systems way and I've run other apps from NTFS parts and copied files around... 澄清:我也得到cat: index: Input/output error.git dir中运行命令cat indexcat: index: Input/output error ,所以这是一个与NTFS相关的问题...但是我从来没有遇到过,直到在跨平台中使用git为止。系统方式,我已经从NTFS部件运行其他应用程序,并在周围复制了文件...

The .git/index file is a binary file, which describes the current workdir. .git/index文件是一个二进制文件,它描述当前的工作目录。 Perhaps a git fsck is able to fix it up (move the one you have out of the way to make sure it isn't lost while you fool around, or make any expertiments on a copy of the repository). 也许git fsck可以修复它(将其移开,以确保它不会在您四处闲逛时丢失,或者在存储库的副本上提供任何专业知识)。 You might try to clone the repository locally, the clone might get a good copy of the file, which you could then copy over the broken one. 您可以尝试在本地克隆存储库,克隆可能会获得文件的良好副本,然后可以将其复制到损坏的副本上。

Possibly permission problems? 可能是权限问题? Backup what is relevant, defragment the drive, run hardware checks (it might be a broken/breaking disk!). 备份相关内容,对驱动器进行碎片整理,运行硬件检查(它可能是损坏的/损坏的磁盘!)。

Either your Linux NTFS driver is broken, or you have filesystem corruption, or both. 您的Linux NTFS驱动程序已损坏,或者文件系统已损坏,或者两者都有。 Reboot to Windows and run the disk checking utility, then see how things stand when it finishes. 重新启动至Windows并运行磁盘检查实用程序,然后查看完成后的状况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Linux / Windows dualboot之间在NTFS分区上共享git repo - Sharing git repo on NTFS partition between Linux/Windows dualboot Git:索引文件打开失败:“git status”的权限被拒绝。 托管在 Bitbucket 上 - Git: index file open failed: Permission denied on “git status”. Hosted on Bitbucket Windows KTM和Transactional NTFS是否有Linux / Unix等价物? - Is there a Linux/Unix equivalent for the Windows KTM and Transactional NTFS? 设备文件在linux系统中打开失败 - device file open failed in linux system 通过USB将Linux本机文件系统作为VFAT或NTFS导出到Windows - Export Linux native filesystem to Windows over USB as VFAT or NTFS 在 Linux 中创建的 NTFS SSD 分区在 windows 中不可见 10 - NTFS SSD Partitions Created in Linux not visible in windows 10 git在windows和linux之间切换后强制刷新索引 - git forces refresh index after switching between windows and linux SFML-无法加载图像-无法打开文件-LINUX - SFML - failed to load image - unable to open file - LINUX Tcl脚本无法在Linux上打开文件(在Windows上适用) - Tcl script cannot open file on Linux (Works on Windows) 在C中,附加到打开的文件以供Windows控制台和Linux上的另一个程序读取 - In C, append to file open for read by another program on Windows console and Linux
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM