如何使用git-svn从不需要的重命名中恢复: [英] How to recover from an unwanted rename using git-svn: "Transaction is out of date"

查看:76
本文介绍了如何使用git-svn从不需要的重命名中恢复:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用git-svn.我已将文件"A"移至"B",并且最新的是svn HEAD(使用git svn rebase).我可以毫无问题地进行所有其他更改.现在,我决定要将"B"移回"A"并提交更改.

I'm using git-svn. I've moved file 'A' to 'B' and I'm up to date with the svn HEAD (using git svn rebase). I can commit all other changes without problems. Now I've decided that I want to move 'B' back to 'A' and commit that change.

当我进行移动并提交给本地主服务器时,它可以正常工作,但是在执行git svn dcommit时得到以下信息:

When I do the move and commit to my local master it works fine, but I get the following when doing a git svn dcommit:

Transaction is out of date: Out of date: 'A' in transaction '3652-1' at /opt/local/libexec/git-core/git-svn line 570

所以我尝试在一个单独的提交中复制和删除,结果是:

So I tried to copy and delete in a separate commit which resulted in:

Item already exists in filesystem: File already exists: filesystem '/usr/svn/db', transaction '3652-1', path 'A' at /opt/local/libexec/git-core/git-svn line 4735

我已经通过使用

I've recovered from this situation with plain svn by using the workarounds like the one described in the documentation, but I don't know how to recover with git-svn. What is going on and how do I fix it?

推荐答案

删除.git/svn对我不起作用.相反,这是我的解决方法:

Removing .git/svn did not work for me. Instead, here's how I resolved:

  • 从存储库中删除有问题的目录(但是我不确定这是否必要.事后看来,我认为我可以跳过此步骤)
  • git svn rebase
  • 在改组期间,存在一些冲突.对于每个冲突,我在文本编辑器中解决了冲突,然后分别使用git add <file-in-conflict>git rebase --continue
  • 成功完成基准调整后,git svn dcommit成功运行!
  • Deleted the offending directories from the repository (But I'm not sure that this is necessary. In hindsight I think I could have skipped this step)
  • git svn rebase
  • During the rebase, there were some conflicts. For each conflict, I resolved the conflicts in text editor, then used git add <file-in-conflict> and then git rebase --continue
  • After rebase completed successfully, git svn dcommit ran successfully!

这篇关于如何使用git-svn从不需要的重命名中恢复:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆