我不確定我的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