2012-12-14 4 views
17

私のGitリポジトリのマスターブランチに最後にマージした後、私はリポジトリを複製する能力を失いました。Git refs/remotes/origin/masterが有効なオブジェクトを指していません

 
Cloning into test-repository... 
remote: Counting objects: 126084, done. 
remote: Compressing objects: 100% (28327/28327), done. 
Receiving objects: 100% (126084/126084), 132.63 MiB | 29.30 MiB/s, done. 
remote: Total 126084 (delta 96101), reused 126078 (delta 96095) 
Resolving deltas: 100% (96101/96101), done. 
error: refs/remotes/origin/master does not point to a valid object! 
error: Trying to write ref refs/heads/master with 
     nonexistant object 951aca8051823b2f202d30c9cb05401ef17618c6 

フィッシュアイ、リポジトリのホスティングツールは、報告されています

 
Unable to fetch from remote repository: 
/var/atlassian/application-data/fisheye/managed-repos/MYREPONAME.git 
error: unable to find 0d998c99b6d01e8aabca72b1934802acf90b8fc9, 
fatal: object 0d998c99b6d01e8aabca72b1934802acf90b8fc9 not found 

最後はマスターブランチ上のリポジトリにコミットがある:

 
commit 0d998c99b6d01e8aabca72b1934802acf90b8fc9 
Merge: a6ea4b3 1f373a9 
Date: Fri Dec 14 13:57:24 2012 +0200 

Merge branch 'new_error_code' 

私が試してみました:

cd /var/atlassian/application-data/fisheye/managed-repos/MYREPONAME.git 
git gc 
git fsck --full 
git reflog expire --expire=0 --all 
git update-ref 
git gc --aggressive 

次の質問がありました通常、あなたが行うことができます

答えて

29
git gc 
git fsck --full 
git reflog expire --expire=0 --all 
git update-ref -d 0d998c99b6d01e8aabca72b1934802acf90b8fc9 
git gc --aggressive 
git remote update --prune 

+0

それは非常に遅く、クローン1よりもコストがかかります。 – suiwenfeng

+3

@Mattここで何が起こるか詳しく説明できますか? – andi

+0

全く説明がありません。あなたはもっと多くの人々が将来これを必要とするかもしれないと考えるべきです。\ \ – PlayHardGoPro

1

:私の場合を助けない

git reflog master 

これはあなたの最後の既知の位置のリストを与えますマスターが指摘している。

あなたが次にチェックアウト一時

git branch temp [email protected]{1} 

すなわちマスターの古いバージョンに一時的なブランチを作成し、それが適切な順序であるかどうかを確認することができ、これを知っていたら。そこに何も表示されていなければ、あなたが以前に行ったコマンド(reflogを削除する、ダングリングコミットを削除するなど)はおそらく回復のためのすべての方法を一掃しました。

関連する問題