Git cannot be retrieved due to corrupt commit

One of our guys clicked on a commit that seems to be intact and runs on his computer. Since then, none of the other computers can retrieve changes from the remote repository. The error that everyone gets is:

git.exe fetch -v --progress "origin" POST git-upload-pack (gzip 1407 to 775 bytes) remote: error: Could not read a75720ce47ae8dcc1d0b4c09fcb7d6f70efa390b remote: fatal: revision walk setup failed remote: aborting due to possible repository corruption on the remote side. fatal: protocol error: bad pack header git did not exit cleanly (exit code 128) (14368 ms @ 26/10/2014 11:49:05) 

A SHA (a75720 ...) that cannot be read is the SHA of the specified commit.

We tried different things, but nothing works. Running git fsck does not show the commit as a hang, and on the remote server, no branches indicate a commit.

Restoring data from commit is not a priority, but getting the system up and running is happening.

Any suggestions on how to remove / fix broken fix? Help would be greatly appreciated.

Thanks!

+5
source share
1 answer

On your local computer, you can reinstall your host before committing to a75720.

Rollback to old Git commit in public repo

Then you can make a cherry fence for the rest. (you can quote the list of commits)

How to select multiple cherry commits

Then, if everything seems to be working, you should do a power push.

git push --force origin requiredBranch

(indicate the desired branch !!)

from: http://git-scm.com/docs/git-push

- force Normally, the command refuses to update the remote ref, which is not the ancestor of the local ref used to overwrite it. In addition, when the --force-with-lease option is selected, the command refuses to update the remote ref, the current value of which does not match what was expected.

This flag disables these checks and may cause the remote repository to lose commit; use it with caution.

Note that -force applies to all refs that are pushed out, therefore using it with push.default set to match or with a few taps, destinations configured with remote. *. push can rewrite links other than the current branch (including local links that are strictly behind their remote counterpart). To force push only one branch, use + before pressing the refspec button (for example, Git press the origin + master to force clicking on the leading branch). See Section ... above for details.

+1
source

Source: https://habr.com/ru/post/1205536/


All Articles