我可以使用本地跟踪git-svn分支来恢复SVN存储库中丢失的提交吗? [英] Can I recover lost commits in a SVN repository using a local tracking git-svn branch?
问题描述
我使用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仓库中重新克隆 在我的旧回购库中重新生成时不会出现任何错误,并且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 Or will the I tried this using 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-svn分支来恢复SVN存储库中丢失的提交吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! http:// tracked-svn / trunk
。
git remote add -f最新版/ path / to / repo
)
git merge remotes / up-to-date / master
git svn dcommit
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.> svn info http://tracked-svn/trunk | sed -n "s/Revision: //p"
252
> git log --grep="git-svn-id:.*@252" --format=oneline | cut -f1 -d" "
55bb5c9cbb5fe11a90ec2e9e1e0c7c502908cf9a
> git svn dcommit 55bb5c9cbb5fe11a90ec2e9e1e0c7c502908cf9a
git-svn-id
need to be stripped from the intended commits?--dry-run
but couldn't tell whether it would try to submit all commits:> git svn dcommit --verbose --dry-run 55bb5c9cbb5fe11a90ec2e9e1e0c7c502908cf9a
Committing to http://tracked-svn/trunk ...
dcommitted on a detached HEAD because you gave a revision argument.
The rewritten commit is: 55bb5c9cbb5fe11a90ec2e9e1e0c7c502908cf9a
http://tracked-svn/trunk
in a fresh git-svn repo.git remote add -f up-to-date /path/to/repo
)git merge remotes/up-to-date/master
git svn dcommit