HG 轉移到 GIT(中文可以轉)
安裝 Git for Windows(Windows要,Linux不用)
- https://gitforwindows.org/
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
安裝 fast-export
git clone https://github.com/frej/fast-export
安裝 dependency
- 開啟Git Bash
pip install pip install mercurial
使用
- 建立本地 git 共享庫
mkdir repo-git
cd repo-git
git init
hg-fast-export.sh -r <local-repo>
git checkout <branch>
git push
範例
- 移至所需轉換的git local
-
將所需HG remote 拉下至local
-
轉換
D:/work_git/fast-export/hg-fast-export.sh -r D:/work_HG/PKI_PKCS11 --force -e big5 --fe big5
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
--fe <指定的檔名編碼>
-
--e <指定的紀錄編碼>
遇到的問題
- 因為編碼問題可能會發生在branch,但似乎沒有指令參數可以設定,錯誤如下:
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- 解法為修改hg2git.py第135行,看你的branch是什麼編碼,像我的是"元大證金",是big5,就改為big5
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
轉移結果圖
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
參考