git svn dcommit没有找到更改并重置头

时间:2011-10-14 19:16:30

标签: git svn git-svn

我对git-svn有一个大问题:我需要将我的git repo推送到svn服务器,所以我做了以下

svn mkdir --parents http://host/path/to/repo/{trunk,tags,branches} \
    -m "Standard layout for $project"
git svn init -s http://host/path/to/repo/
git svn fetch
git rebase trunk master
git svn dcommit

这很有效,一切都在git和svn上!

现在我得到的消息是我的git master分支在origin / master之后是31次提交,所以我做了一个git pull。 现在我在我的仓库中更改了一些东西(基本上是一个eclipse java项目)并提交了它。现在我也想在svn repo上推它并制作一个     git svn dcommit 但那不起作用:

Committing to https://..../trunk ...
No changes
38b194cb2860b8bb73924cb05f9830dbdb70cf82~1 == 38b194cb2860b8bb73924cb05f9830dbdb70cf82
No changes between current HEAD and refs/remotes/trunk
Resetting to the latest refs/remotes/trunk
Unstaged changes after reset:
M       Product/Abgabe.tex
Unable to extract revision information  from commit daf483ad1333f3589386b87054f4c27fb7ff23cf~1

我做错了什么?现在,master已重置为提交,现在我需要git checkout -- Abgabe.texgit pull才能在此处使用正确的版本...

编辑:如果我做git svn rebase,我会为每个提交获得一长串冲突,所以我将git rebase --skip设置为最终,然后dcommted,这是有效的,但它似乎是一个血腥的黑客:/

1 个答案:

答案 0 :(得分:7)

我认为您工作流程中缺少的是git svn rebase http://flavio.castelli.name/2007/09/04/howto_use_git_with_svn/