SVN——SVN项目迁移到GIT

svn有很多优点,但是git的出现对svn的冲击的确很大,现在很多公司项目的都迁移的git上了,下面是我自己在做svn迁移项目到git上面时候整理的一些资料,包括svn的提交日志记录也迁移到Git上面。

暂时就些整理这些,具体的操作如果有看不懂的,可以和我联系!右侧的qq号,欢迎一起探讨。 
相关操作: 

##clone svn -> git  地址支持协议 : svn://, http://, https://. 注意这个 URL 应该指向项目的 base repository,例如 ##http://svn.mycompany.com/myrepo/repository. 不要指到了 /trunk, /tag 或 /branches 里。
git svn clone svn://10.68.245.11/tclshop --authors-file=users.txt --no-metadata -s dufy-move 
##进入clone 的文件夹
cd dfuy-move 
##使所有的 SVN commit 都被抓下来了
git svn fetch
##在git中查看svn commit记录信息
git log --pretty=oneline
##查看分支 -- svn tag的被解析为git分支 ,需转换一下
git branch -r 
##转换分支-tag  
git tag tags_20160329_hg origin/tags/tags_20160329_hg  
##删除远程的分支(tags)
git branch -r -d origin/tags/tags_20160329_hg   
##本地初始化git仓库完成
git remote add origin git@10.68.25.20:move/dufy-tclshop-test-two.git 
#推送到远端的git的仓库中
git push origin master --tags
##切换到分支
git checkout 16130_20151125_hg 
##提交分支到远程的仓库中
git push origin 16130_20151125_hg 

 


2:使用TortoiseGit 客户端也可以进行相关的操作 
这里写图片描述

参考资料: 
8.2 Git 与其他系统 - 迁移到 Git 
https://git-scm.com/book/zh/v1/Git-%E4%B8%8E%E5%85%B6%E4%BB%96%E7%B3%BB%E7%BB%9F-%E8%BF%81%E7%A7%BB%E5%88%B0-Git

将代码库从 SVN 迁移至 Git 并保留所有 commit 记录 
http://www.lovelucy.info/codebase-from-svn-to-git-migration-keep-commit-history.html

svn 迁移到git下全过程 
http://www.aikaiyuan.com/6584.html

git与svn 共舞 
https://www.chenyudong.com/archives/git-and-svn-collaboration.html

SVN迁移到Git的过程(+ 一些技巧) 
http://www.blogjava.net/lishunli/archive/2012/01/15/368562.html

posted on 2017-09-15 18:22  &大飞  阅读(129)  评论(0编辑  收藏  举报

导航