我对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
Run Code Online (Sandbox Code Playgroud)
这很好用,一切都在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
Run Code Online (Sandbox Code Playgroud)
我做错了什么?主人现在重置为提交之前,现在我需要git checkout -- Abgabe.tex并git pull在这里拥有正确的版本......
编辑:如果我做了git svn rebase,我得到每个提交一长串的冲突,所以我做到git rebase --skip最后,然后dcommted,这是工作,但它似乎是一个血腥的黑客:/
我认为你工作流程中缺少的是git svn rebase
http://flavio.castelli.name/2007/09/04/howto_use_git_with_svn/