When I did a git svn rebase it stopped at one point saying:
Index mismatch: SHA key of a tree != SHA key of another tree.
(I come to know that these SHA keys corresponds to a tree and not a commit from git show of the above two sha keys.)
re-reading <sha index of a commit in svn/trunk>
... list of files ...
fatal: bad object <SHA1 index of the bad object>
rev-list -1 <SHA1 index of the bad object> --not <SHA1 index of the revision it was trying to re-read>: command returned error: 128
I am not very experienced in the internal workings of git, so is there a sequence of steps to follow to dissect problems like these and possibly resolve them?
Likely, you may also have Checksum mismatch at the same time in your message:
I found solution here Git svn rebase : checksum mismatch:
Please don't remove the .git/svn folder to fix this. It requires you to rebuild everything, it is annoying, it will take awhile (for the size of my repo several hours) and it is NOT NECESSARY.
I found the right answer here and I've included it below.
From the link:
Inside the .git directory run the following:
Now delete the matching .svn/.caches from the output of the first command
Now
git svn rebase
orgit svn fetch
to your heart's content.In my case, the issue was caused by a new/unknown svn author who was not in my
authors
file that git-svn was configured to use. It reported it in the output that that I ignored the first few reads:So that gave me the name that I was missing, and what file to add it too (I pulled the email from my organizations user registry) and was smooth sailing.
Maybe something to do with Copy-On-Write feature of your filesystem (ext4/btrfs/etc...) ?
See : https://stackoverflow.com/a/42299634/7491491
I got this error:
Index mismatch: <sha> != <sha> re-reading <sha index of a commit in svn/trunk> ... list of files ... <path> was not found in commit <sha> (r<svn rev>)
Looking in SVN repo at the history of the reported path, I found the SVN revision where the file had been added. But looking in Git at the commit created for that revision I found that it didn't contain any files!
I think this had been caused by a full disk earlier. After doing a
git svn reset -r
back to the revision of the broken Git commit,git svn fetch
worked fine again.I just had this error myself. Just delete the ref, like so:
That should clear up the error.