We use svn, and I use git-svn to maintain sanity. At one point, our svn server decided to return a 403 for a certain folder. It happened to everybody, not just me.
A better way to do this now is git svn reset -r <rev>
where rev is the revision before where you want to start refetching. After that's done, just run git svn fetch
and it will rebuild its index and refetch the revisions after rev.
First make a backup of your .git directory.
Remove the .rev_map.$UUID
file for the problem branch, below .git/svn
; and rewind the git-svn
-generated branch that represents the problem branch (typically, trunk
). To rewind the branch, run git pack-refs --all
, git log $BRANCH
, find the commit before the problem commit, and edit .git/packed-refs so that the branch now points to the older commit. Then run git svn fetch
. It will rebuild the rev-map from your existing, rewound branch, then fetch the svn commits that you don't have yet, including the problem commit. You should now be able to rebase and dcommit normally.
git svn reset -r <last-good-revision>
(@dOxxx's answer) is simple and works most of the case, except when the commit to re-fetch is the first commit of the branch. @Tobu's answer works even in that case.
This is a bit refined version of @Tobu's. (Difference is that you can use git update-ref
command to edit a ref)
.git
directory.git/svn/refs/remotes/<your-svn-remote>/<your-svn-branch>
directorygit update-ref refs/remotes/<your-svn-remote>/<your-svn-branch> <last-good-commit>
git svn fetch
will re-fetch SVN commits after <last-good-commit>