原項目使用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