我使用git-svn跟踪的SVN回购最近已损坏,备份已恢复。然而,在经济复苏中,一周的承诺失败了。是否有可能在我的本地git仓库中使用 git-svn dcommit 来恢复那些丢失的提交?运行 git-svn dcommit 与SVN中最后一次恢复提交的SHA1是否足够?例如
> svn info http:// tracked-svn / trunk | sed -ns / Revision:// p 252 > git log --grep =git-svn-id:。* @ 252--format = oneline | cut -f1 -d 55bb5c9cbb5fe11a90ec2e9e1e0c7c502908cf9a > git svn dcommit 55bb5c9cbb5fe11a90ec2e9e1e0c7c502908cf9a或者 git-svn-id 需要从预期的提交中剥离出来
我试着用 - dry-run 但不知道它是否会尝试提交所有提交:
> git svn dcommit --verbose --dry-run 55bb5c9cbb5fe11a90ec2e9e1e0c7c502908cf9a 承诺为http:// tracked-svn / trunk ... 由于您提供了修订版参数,因此在分离的HEAD上提交了dcommit。 重写的提交是:55bb5c9cbb5fe11a90ec2e9e1e0c7c502908cf9a感谢您的帮助。
解决方案以下是我如何达到我想要的: 在新的git-svn仓库中重新克隆 http:// tracked-svn / trunk 。 在我的旧回购库中重新生成时不会出现任何错误,并且dcommit可按预期工作。 不是恢复提交的最佳方式,但它使我得到了我想要的。 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 those lost commits using git-svn dcommit on my local git repo? Is it sufficient to run git-svn dcommit with the SHA1 of the last recovered commit in SVN? eg. Or will the git-svn-id need to be stripped from the intended commits? I tried this using --dry-run but couldn't tell whether it would try to submit all commits: Thanks for your help. Here is how I achieved what I wanted:
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.
更多推荐
我可以使用本地跟踪git
发布评论