既然要用 Git 了,就要把之前 SVN 版本庫全轉成 Git,以前或許很複雜,但我現在轉 (直接用 Git 內鍵的指令) 已很容易了。

開始 找出有那些使用者 (在 SVN Server),因為 Git 會用到這樣子的資訊

這是行 svn log 裡查全部 svn 裡 commit 的使用者有誰

svn log --quiet svn://localhost/mycode

假如使用者單純的話,可以直接查看 SVN 版本庫裡的 conf 裡的 authz,內容就有那些人在對這個 SVN 使用,但有可能漏掉,因為人會來來去去的等等。

再來將使用者寫到一個檔案裡面,並 mapping 一組是 git 要用的

比如,有 cross 與 cross2 這兩個帳號,把它們配對出一組 user + email

cross = cross <cross@ssorc.tw>
cross2 = cross2 <cross2@ssorc.tw>

然後執行

git svn clone svn://localhost/mycode -A SVNuser.txt --username=cross mycode.git

就會產生出 mycode.git 目錄

再傳到 GitLab

cd mycode.git
git push --mirror https://git.ssorc.tw:8883/my/code.git

這樣子就可以了

 

假如是在 Windows 上作,遇到

4 [main] perl 5472 child_info_fork::abort: unable to map C:\Program Files\Git\usr\bin\msys-svn_subr-1-0.dll, Win32 error 1114

可以重新安裝使用 Git 32bit 版本,就沒有問題了

 

Related posts 相關文章
最近要小心 GitHub 上的 POC 庫,可能是惡意程式
More...
下載 GitHub 上某個目錄
More...
gitlab 出現 cannot unblock ldap blocked users 問題
More...
讓 Git 儲存帳密支援 Windows Credential Manager
More...

作者

留言

撰寫回覆或留言

發佈留言必須填寫的電子郵件地址不會公開。