SVN 轉 GIT


SVN 轉爲 Git 步驟:
1. 查看分支
$ svn ls svn://*/lngi2.0 --verbose
   2450 admin                 4▒▒ 01 11:17 ./
   2442 b              2▒▒ 25 10:10 Document/
   1363 c                1▒▒ 31  2018 Software/
   2450 d                     4▒▒ 01 11:17 branch/
   2449 e                      3▒▒ 30 14:42 doc/
    103 f                7▒▒ 19  2016 trunk/

svn ls svn://*/lngi2.0/branch --verbose  

   2450 admin                 4▒▒ 01 11:17 ./
   2441 b              2▒▒ 19 16:16 2.0P/
   2447 c              2▒▒ 28 13:27 Build/
   2000 d                 2▒▒ 25  2019 GEM_del/
   2450 admin                      4▒▒ 01 11:17 GlobalA/
   2209 e                      7▒▒ 18  2019 ThirdPartyLibraries/


2. 查看提交的人員
svn log --xml | grep "^<author" | sort -u | \awk -F '<author>' '{print $2}' | awk -F '</author>' '{print $1}' > userinfo.txt


3. 通過git svn clone克隆一個git版本庫

git svn clone svn://*/trunk --no-metadata  --no-minimize-url --authors-file=userinfo.txt trunk
git svn clone svn://*/Document --no-metadata  --no-minimize-url --authors-file=userinfo.txt Document
git svn clone svn://*/Software --no-metadata  --no-minimize-url --authors-file=userinfo.txt Software
git svn clone svn://*/doc --no-metadata  --no-minimize-url --authors-file=userinfo.txt doc
git svn clone svn://*/2.0P/ --no-metadata  --no-minimize-url --authors-file=userinfo.txt 2.0P


4. 關聯遠程倉庫
git remote add origin http://*.git

5. 新建分支
git branch 2.0P

6.切換分支 
git checkout 2.0P/

7. 推送到遠程分支
git push --set-upstream origin GEM_del
 
git push -u origin 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章