git svn - <file> was not found in commit <hash> git svn - <file> was not found in commit <hash> git git

git svn - <file> was not found in commit <hash>


This probably means that you are receiving a new svn revision which modifies a file which (for some reason) does not exist in your git commit equivalent of the parent svn revision. One very easy way to cause this is to be inconsistent with --ignore-paths (originally there was no way to configure those and they had to be entered on every git-svn command line that might fetch). Another way is for someone on the svn server end to change repository permissions in such a way that a whole subtree of files suddenly appears (from your perspective) that your git repository has no history for.

The easiest way to get past this immediate problem and continue git-svn fetch is to use --ignore-paths (or better the svn-remote.svn.ignore-paths config entry) to ignore the problem part of the tree. You can get away with the command line argument to pass a single revision and you won't hit the problem again until someone modifies it on the svn side.

If you want to recover without --ignore-paths then you will need to fix the parent revision so that it includes the file being modified. I wrote git-svn reset specifically to do the "un-fetch" you refer to with less tinkering. It can reset your svn remote back to where the file was really created so you can integrate it into your history. This won't wipe out your working copies, but you will need to reparent any working branches on this new history.


I got this error from git svn fetch when the repository had svn:externals urls set, and my --ignore-paths regexp would filter them out.


A quick solution here is to reset to a revision fairly before problematic one.

git svn reset <a past revision>

For example, when an error message mentions r1000 e.g. run git svn reset r990, etc.

And run git svn rebase or git svn fetch.