git svn dcommit无法工作

3
我需要将一个扩展的 git 仓库迁移到一个新的 svn 仓库。我将按照以下步骤进行操作:http://sandrotosi.blogspot.com/2010/02/migrate-git-repo-to-svn-one.html
问题是,当我运行命令时:
git svn dcommit

错误信息如下:
digger$ git svn dcommit
Committing to http://repository_url_path/trunk ...
A   .gitmodules
A   vendor/rails
6ce13429cbc1359d85e1dc99c84561840e89d455 doesn't exist in the repository at /opt/local/libexec/git-core/git-svn line 4277
Failed to read object 6ce13429cbc1359d85e1dc99c84561840e89d455 at /opt/local/libexec/git-core/git-svn line 558

我该怎么修复它?

谢谢!


1
听起来你的 git 仓库不完整?或者你正在使用子模块之类的东西?git show 6ce13429cbc1359d85e1dc99c84561840e89d455 显示了什么? - Damien Pollet
1
你应该使用 git fsck 命令来检查你的代码库。 - Rudi
2
请参考 https://dev59.com/ElTTa4cB1Zd3GeqPr2FD,这是由于使用了git子模块的原因。 - freespace
3
freespace - 你的评论是递归的! - Jesse
显示剩余3条评论
1个回答

4

您正在使用git-svn子模块。

您可以重写git历史记录以删除它(点击此处)

$ git tag bad mywork~5
$ git checkout bad
$ # make changes here and update the index
$ git commit --amend
$ git rebase --onto HEAD bad mywork

或者更简单的,可以参考http://ignoredbydinosaurs.com/2011/06/quick-trip-panic-room

$ git filter-branch --index-filter 'git rm --cached --ignore-unmatch vendor/rails'

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接