Git is missing when cloning over SSH
I'll take care of the company's Git repos. We are using Gitosis to manage our Git repositories. I have cloned one repository across git clone git@gitserver:repo
and some commits were not found at all. git show <commit>
returns fatal: bad object f723e2ea9af0e380158d90c36e21a60991760d31
.
Objects below, there is only one package file:
$ tree .git/objects/
.git/objects/
|-- info
| `-- packs
`-- pack
|-- pack-4d930eca23ad902fc4a4809d01b86c4217b0b262.idx
`-- pack-4d930eca23ad902fc4a4809d01b86c4217b0b262.pack
2 directories, 3 files
I cannot find the commit in the package file:
$ git verify-pack -v .git/objects/pack/pack-4d930eca23ad902fc4a4809d01b86c4217b0b262.idx | grep f723e2e
$
When I clone a repository on a Git server using the local filesystem, the commits are there and can be checked out.
I can find the commit (first):
$ ls .git/objects/f7/
23e2ea9af0e380158d90c36e21a60991760d31 84f33d44863cbe6ca4ae03cddcc673048f04bb
3b1ef7031d634b4aa443925dd29cc779356caa 9807359a1c65f312a1d4642e5191416443e20b
6fbd26fccc5a8e89f221c9196eb8083e73632e
How can my users get all the commits when cloned over SSH?
source to share
Since you can clone on the server try which will give you a single file. git bundle
Then copy this file to your local machine and clone it from this package.
You can check after this "bundle" clone if you can:
- add the remote server back to the gitosis repository
- push / pull from the above gitosis repository upwards.
(Note: if you find that a commit is on a corrupt repo, check if their size is 0 and try deleting it or restoring it from another clone )
source to share