我不确定我的git存储库发生了什么,但是两天之后,每次我做出提交时,它都会随机地开始删除文件,然后不让我由于冲突等原因合并等。删除旧版本后创建一个新的git存储库
我已经将应用程序恢复为可用状态,我想我只是删除.git文件并运行git init
来创建新的git。
当我这样做,我得到
git init fatal: cannot copy '/usr/share/git-core/templates/hooks/commit-msg.sample' to '/media/sf_Ruby192/myapp/.git/hooks/commit-msg.sample': Operation not permitted
--------------- LS -al
这在虚拟机器上运行的Ubuntu上的UPDATE Windows主机。奇怪的是,这已经运行了大约7个月没有问题,然后GIT突然开始删除文件,我想我的.git已经损坏,试图重新构建它,并遇到所有这些问题。
total 62 drwxrwx--- 1 root vboxsf 4096 2012-03-16 15:03 . drwxrwx--- 1 root vboxsf 8192 2012-03-15 13:29 .. drwxrwx--- 1 root vboxsf 4096 2012-02-20 06:43 app drwxrwx--- 1 root vboxsf 4096 2012-03-16 09:45 config -rwxrwx--- 1 root vboxsf 161 2011-12-27 05:31 config.ru drwxrwx--- 1 root vboxsf 4096 2012-03-08 09:58 db drwxrwx--- 1 root vboxsf 0 2011-12-27 05:31 doc -rwxrwx--- 1 root vboxsf 1369 2012-02-27 07:23 Gemfile -rwxrwx--- 1 root vboxsf 4374 2012-02-27 07:24 Gemfile.lock -rwxrwx--- 1 root vboxsf 86 2012-02-22 13:21 .gitignore drwxrwx--- 1 root vboxsf 0 2012-02-20 06:43 lib drwxrwx--- 1 root vboxsf 4096 2012-02-22 08:50 log drwxrwx--- 1 root vboxsf 4096 2012-03-18 09:02 public -rwxrwx--- 1 root vboxsf 274 2011-12-27 05:31 Rakefile -rwxrwx--- 1 root vboxsf 9386 2011-12-27 05:31 README drwxrwx--- 1 root vboxsf 0 2012-02-27 07:16 redis drwxrwx--- 1 root vboxsf 4096 2011-12-27 05:31 s drwxrwx--- 1 root vboxsf 0 2011-12-27 05:31 script drwxrwx--- 1 root vboxsf 0 2011-12-27 05:31 solr -rwxrwx--- 1 root vboxsf 4 2012-02-20 06:43 sunspot-solr.pid drwxrwx--- 1 root vboxsf 4096 2011-12-27 05:31 test drwxrwx--- 1 root vboxsf 4096 2011-12-27 05:31 thin drwxrwx--- 1 root vboxsf 0 2011-10-09 09:23 tmp drwxrwx--- 1 root vboxsf 0 2011-12-27 05:31 vendor
------------------ UPDATE ------------------------ -----
通过布赖恩推荐的步骤去,有一个.git
目录(这是我新,并运行初始git init
之前已经更名。当我这样做的ls -l .git
,我得到
ls cannot access .git: No such file or directory
但是,我可以cd到.git文件夹中,但也不能从.git里面运行-ls
,因为我得到了
ls cannot access directory: Operation not permitted
有关如何摆脱这个漏洞的任何建议?
你对你的文件系统有任何问题吗?例如您的文件系统是否以只读方式重新装入?或者可能存在权限问题? – kclair 2012-03-16 21:16:03
@kclair,git告诉我我有问题(或有问题),但我一直在添加,删除,移动文件没有问题。 – pedalpete 2012-03-16 21:19:52
好的...我只是说我认为这个错误看起来像一个直接的文件系统或权限错误。 /media/sf_Ruby192/myapp/.git/是否已经存在?该目录的ls -la是什么样的? – kclair 2012-03-16 21:24:17