Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CONVERTING THE CVS REPOS TO GIT
- You will need:
- - Linux VM/WSL (Ubuntu 18.04 Recommended)
- - git
- - cvs2git (Ubuntu package: cvs2svn - use 18.04; 20.04 removed this!)
- 1. Find the directory you want to convert to git. This will be the folder with a CVSROOT subfolder inside.
- For example:
- ├───folder
- │ ├───CVSROOT
- │ │ └───stuff
- │ │
- │ ├───file1
- │ └───folder
- │ └───file2
- The directory "folder" will be the one you want to convert.
- 2. Navigate to the directory in WSL/Linux that the folder is in, but don't go inside the folder itself.
- 3. Convert the repositories using cvs2git. Replace path/to/directory/ with the folder you want to convert:
- cvs2git --blobfile=blob.dat --dumpfile=dump.dat --username=cvs2git path/to/directory/
- The command may take a long itme, and the generated files will take up a lot of space, so run this on an HDD with enough space.
- If it encounters errors about unable to convert log files, try this command, once again replacing path/to/directory/ with the folder you want to convert:
- cvs2git --encoding=euc_jp --encoding=euc_jis_2004 --encoding=euc_jisx0213 --encoding=iso2022_jp --encoding=iso2022_jp_1 --encoding=iso2022_jp_2 --encoding=iso2022_jp_2004 --encoding=iso2022_jp_3 --encoding=iso2022_jp_ext --encoding=shift_jis --encoding=shift_jis_2004 --encoding=shift_jisx0213 --encoding=utf_16 --encoding=utf_16_be --encoding=utf_16_le --encoding=utf_7 --encoding=utf_8 --blobfile=blob.dat --dumpfile=dump.dat --username=cvs2git path/to/directory/
- The error about converting the logs is due to the repositories using Japanese characters, so the command above will keep trying different character formats to convert it to until one works.
- 4. Convert the dump files to git repositories:
- mkdir repository-git
- cd repository-git
- git init
- cat ../blob.dat ../dump.dat | git fast-import
- git reset --hard
- The folder name can be anything you want, but I prefer using the original foldername with a -git suffix to make it easy to identify.
- Once that command completes, the directory will be decoded and converted into a working git repository. It will work as any old git repository, so you can even commit to it or revert back to an old version.
- The "blob.dat" and "dump.dat" files can be deleted once everything is done.
RAW Paste Data