私は私のgit repoに何をしたのか分からない、誰かが間違ったことを説明できるか? 私の最初のコマンドは:git commit -m "another commit" .
git push -u origin master
でした。私はgit fsck --full
を試して、問題を解決しなかった別のSOの投稿に基づいてファイルを削除しました。この時点で、私はどんな提案をしても、Googleに何を知らないのだろうか?一般的な固定壊れたリポジトリでgit blobがプッシュで失敗する
[email protected] MINGW64 ~/Desktop/_REPOS/misc (master)
$ git fsck --full
Checking object directories: 100% (256/256), done.
error: bad object header1403/1404)
error: unknown object type -1 at offset 12 in .git/objects/pack/pack-627dd5f8d19a0d3289d2dc5bb37e776aa845ae2f.pack
error: cannot unpack 7884ba2578c7535a2e3b70d410f0286bd2e0016f from .git/objects/pack/pack-627dd5f8d19a0d3289d2dc5bb37e776aa845ae2f.pack at offset 12
Checking objects: 100% (1404/1404), done.
[email protected] MINGW64 ~/Desktop/_REPOS/misc (master)
$ rm -f .git/objects/pack/pack-627dd5f8d19a0d3289d2dc5bb37e776aa845ae2f.pack
[email protected] MINGW64 ~/Desktop/_REPOS/misc (master)
$ git fsck --full
Checking object directories: 100% (256/256), done.
Checking objects: 100% (1403/1403), done.
missing blob 7884ba2578c7535a2e3b70d410f0286bd2e0016f
[email protected] MINGW64 ~/Desktop/_REPOS/misc (master)
$ git commit -m "trying again" .
error: invalid object 100644 7884ba2578c7535a2e3b70d410f0286bd2e0016f for '3212703ED955F10C7534BE8497B221F4/tester/history/EURUSD1440_0.fxt'
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
[email protected] MINGW64 ~/Desktop/_REPOS/misc (master)
$ git push -u origin master
Counting objects: 70, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (65/65), done.
fatal: unable to read 7884ba2578c7535a2e3b70d410f0286bd2e0016f
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
fatal: write error: Bad file descriptor
error: failed to push some refs to 'https://[email protected]/yzpaul/misc-scripts.git'
[email protected] MINGW64 ~/Desktop/_REPOS/misc (master)
$ git fsck --full
Checking object directories: 100% (256/256), done.
Checking objects: 100% (1403/1403), done.
missing blob 7884ba2578c7535a2e3b70d410f0286bd2e0016f
[email protected] MINGW64 ~/Desktop/_REPOS/misc (master)
$ git reflog expire --expire=now --all
[email protected] MINGW64 ~/Desktop/_REPOS/misc (master)
$ git push -u origin master
Counting objects: 70, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (65/65), done.
fatal: unable to read 7884ba2578c7535a2e3b70d410f0286bd2e0016f
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
fatal: write error: Bad file descriptor
error: failed to push some refs to 'https://[email protected]/yzpaul/misc-scripts.git'
[email protected] MINGW64 ~/Desktop/_REPOS/misc (master)
$ git hash-object -w 7884ba2578c7535a2e3b70d410f0286bd2e0016f
fatal: Cannot open '7884ba2578c7535a2e3b70d410f0286bd2e0016f': No such file or directory
[email protected] MINGW64 ~/Desktop/_REPOS/misc (master)
$ git prune
[email protected] MINGW64 ~/Desktop/_REPOS/misc (master)
$ git prune --expire=now
[email protected] MINGW64 ~/Desktop/_REPOS/misc (master)
$ git push -u origin master
Counting objects: 70, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (65/65), done.
fatal: unable to read 7884ba2578c7535a2e3b70d410f0286bd2e0016f
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
fatal: write error: Bad file descriptor
error: failed to push some refs to 'https://[email protected]/yzpaul/misc-scripts.git'
[email protected] MINGW64 ~/Desktop/_REPOS/misc (master)
$ git push -u origin master --force
Counting objects: 70, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (65/65), done.
fatal: unable to read 7884ba2578c7535a2e3b70d410f0286bd2e0016f
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
fatal: write error: Bad file descriptor
error: failed to push some refs to 'https://[email protected]/yzpaul/misc-scripts.git'
[email protected] MINGW64 ~/Desktop/_REPOS/misc (master)
$ git gc --prune --agressive
error: unknown option `agressive'
usage: git gc [<options>]
-q, --quiet suppress progress reporting
--prune[=<date>] prune unreferenced objects
--aggressive be more thorough (increased runtime)
--auto enable auto-gc mode
--force force running gc even if there may be another gc running
[email protected] MINGW64 ~/Desktop/_REPOS/misc (master)
$ git gc --prune=8-12-2016
Counting objects: 1418, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (748/748), done.
fatal: unable to read 7884ba2578c7535a2e3b70d410f0286bd2e0016f
error: failed to run repack
[email protected] MINGW64 ~/Desktop/_REPOS/misc (master)
$
もう1つ注意してください:リポジトリのファイルシステムを確認し、ハードウェアをチェックしてください。 Gitリポジトリで、Gitの外部の理由なしにランダムなデータ破損エラーを取得するのはかなり難しいです。 – kostix