0

I have GIT repository that I want to backup on another server.

So I've created a clone mirror, set push origin url pointing to the backup GIT server and finally tried to push

$ git clone --mirror <source url>
$ git remote set-url --push origin <dest url>
$ git push --mirror

Getting error

error: remote unpack failed: error The commit object b6bcc7e7dc06ab6f24e5a90384c92b39f68c2324 was rejected: Commit comment contained one or more null bytes

Commit is from 2015 and the message looks good, only printable characters. Don't see any null bytes.

$ git log -n 1 b6bcc7e7dc06ab6f24e5a90384c92b39f68c2324 | xxd

I even tried to reword the message with git rebase -i, but got too much conflicts and aborted the rebase as would like to avoid force push.

How can I identify the exact issue or how can I skip this commit?

Stanislav Stoyanov
  • 2,082
  • 2
  • 20
  • 22
  • Maybe `git fsck` would help? Also it doesn't say the commit _message_ was rejected but rather the commit _content_, which refers to the entire commit object. I think you could dump the raw commit object using `git cat-file -p b6bcc7e7dc06ab6f24e5a90384c92b39f68c2324`. – Thomas Jun 26 '20 at 07:54
  • known issue on OS X Mavericks and NUL chars: https://stackoverflow.com/questions/20696643/how-do-i-keep-nul-bytes-from-appearing-throughout-my-git-repository-and-commit-m – Daemon Painter Jun 26 '20 at 07:56
  • @Thomas, this only lists warning for the commit ```error in commit b6bcc7e7dc06ab6f24e5a90384c92b39f68c2324: nulInCommit: NUL byte in the commit object body``` – Stanislav Stoyanov Jun 26 '20 at 08:01
  • @DaemonPainter, in my case the commit in question is from 2015, if git doesn't like Null characters in the message, how this commit was pushed. And why I don't see the bad characters with ```xxd```. – Stanislav Stoyanov Jun 26 '20 at 08:06

0 Answers0