原项目使用git管理. 由于各类缘由须要提交到svn库.参考资料git
svn co http://svn.example.com/foo cd myproj svn mkdir trunk svn commit -m'Created trunk directory'
或者直接在现有的repository上建立目录shell
svn mkdir --parents http://url/dir_name --message "messages"
2.1 clone git项目svn
git clone ~git/repositories/foo/mainline.git ~git/repositories/svn-mirror/foo cd ~git/repositories/svn-mirror/foo
2.2 在.git/config中添加svn-remotefetch
[svn-remote "svn"] url = http://svn.example.com/foo/trunk fetch = :refs/remotes/git-svn
3.1 从空的svn远程库中作初始化fetch,并将其做为一个新分支checkouturl
git svn fetch svn git checkout -b svn git-svn
3.2 将master分支merge进svn分支并提交到svn库
merge时发生 fatal: refusing to merge unrelated histories
错误, 可加 --allow-unrelated-histories
code
git merge master git svn dcommit
git checkout master git rebase svn git branch -d svn