Can I recover lost commits in a SVN repository using a local tracking git-svn branch?

后端 未结 3 1303
故里飘歌
故里飘歌 2020-12-19 17:25

A SVN repo I use git-svn to track was recently corrupted and a backup was recovered. However, a week\'s worth of commits were lost in the recovery. Is it possible to recover

3条回答
  •  感情败类
    2020-12-19 18:04

    Here is how I achieved what I wanted:

    1. Re-cloned http://tracked-svn/trunk in a fresh git-svn repo.
    2. Added my old git-svn repo as a remote to the fresh repo. (eg. git remote add -f up-to-date /path/to/repo)
    3. git merge remotes/up-to-date/master
    4. git svn dcommit

    Rebasing on my old repo gives no errors, and dcommit works as expected.

    This might not be the best way to recover commits, but it got me what I wanted.

提交回复
热议问题