svn有很多優點,但是git的出現對svn的沖擊的確很大,現在很多公司項目的都遷移的git上了,下面是我自己在做svn遷移項目到git上面時候整理的一些資料,包括svn的提交日志記錄也遷移到Git上面。
暫時就些整理這些,具體的操作如果有看不懂的,可以和我聯系!右側的qq號,歡迎一起探討。
相關操作:
1:命令行執行
##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
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
作者:阿飛云
鏈接:https://blog.csdn.net/u010648555/article/details/52831194
來源:CSDN
著作權歸作者所有,任何形式的轉載都請聯系作者獲得授權并注明出處。
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~