问题
A friend of mine and I have been trying to use git for a project. It is hosted on his server, and I git clone it as:
git clone username@IP.ADD.RE.SS:/path/to/git/repos.git
Pretty standard stuff, and it works great for a while. But every time one of us has added a large commit (which git supposedly handles very well), of the order of 100MB or so, the git repository gets kind of broken. Basically, at this point I will be able to push new changes and pull other changes (I think), but when I try to clone the repository in a fresh location using that command above, I get an error message that says:
$git clone username@IP.ADD.RE.SS:/path/to/git/repos.git
Initialized empty Git repository in /local/path/to/repos/.git/
remote: Counting objects: 1455, done.
remote: Compressing objects: 100% (1235/1235), done.
error: git upload-pack: git-pack-objects died with error.s
fatal: git upload-pack: aborting due to possible repository corruption on the remote side.
remote: aborting due to possible repository corruption on the remote side.
fatal: early EOF
fatal: index-pack failed
This has happened 3 or 4 times now, and it's always when I add a large commit. Any idea why this is happening? How can we fix it? We're both using Mac OSX Snow Leopard.
Thanks! -M
回答1:
Very late response here. You'll probably need to get back onto the server and locate the repository there and from within the directory run:
git gc
or
git gc --aggressive
回答2:
Is the push to the remote server failing? Maybe there is some packet loss on the connection and delta's are incomplete. Try setting up a bare repository on your local machine to push to and clone from and tell if it's still breaking.
来源:https://stackoverflow.com/questions/3002125/git-repository-gets-corrupted-when-i-do-a-large-commit-possible-repository-cor