Convert the SVN repository to GitLab: Difference between revisions

Minor cosmetic changes.
(SVN to Git - adding content)
 
(Minor cosmetic changes.)
 
Line 1: Line 1:
==Following this guide allows one to convert a specific SVN repository to a GitLab project, including turning SVN revisions to commits and the participants to GitLab users.==
'''Following this guide allows one to convert a specific SVN repository to a GitLab project, including turning SVN revisions to commits and the participants to GitLab users.'''




Line 5: Line 5:
* Obtain the SVN url of the repository in question. The one used has already been converted, use it as an example.
* Obtain the SVN url of the repository in question. The one used has already been converted, use it as an example.
* cd to /home/neal/git/svn This is an empty folder reserved for the conversion process:
* cd to /home/neal/git/svn This is an empty folder reserved for the conversion process:
** git svn clone --no-minimize-url http://saturn:8008/svn/Apoyar/BMAPI/BleckmannApi .
** git svn clone --no-minimize-url <nowiki>http://saturn:8008/svn/Apoyar/BMAPI/BleckmannApi</nowiki> .
* Examine the results in the folder. Use git status to check.
* Examine the results in the folder. Use git status to check.
* Create new project on GitLab. Copy its url. In this example, the BleckmannAPI project has been used, please use yours.
* Create new project on GitLab. Copy its url. In this example, the BleckmannAPI project has been used, please use yours.
* Push to GitLab:
* Push to GitLab:
** git remote add origin https://gitlab.apoyar.eu/root/BleckmannAPI.git
** git remote add origin <nowiki>https://gitlab.apoyar.eu/root/BleckmannAPI.git</nowiki>
** git push –u origin master
** git push –u origin master
* GitLab will now show all commits and files of the repository. Only master branch will exist
* GitLab will now show all commits and files of the repository. Only master branch will exist
Line 18: Line 18:
** Make the master branch unprotected
** Make the master branch unprotected
** Copy the git-author-rewrite.sh file (residing in the parent folder: /home/neal/git/) to the current svn folder.
** Copy the git-author-rewrite.sh file (residing in the parent folder: /home/neal/git/) to the current svn folder.
** <span id="edit_script">Edit the file and replace the following values with their current ones:</span>.  
** '''Edit the file and replace the following values with their current ones:'''.
*** OLD_EMAIL=" "
*** OLD_EMAIL=" "
*** CORRECT_NAME=" "
*** CORRECT_NAME=" "
Line 28: Line 28:
** delete the backup:
** delete the backup:
*** git update-ref -d refs/original/refs/heads/master
*** git update-ref -d refs/original/refs/heads/master
** if there are more usernames just repeat the steps from [[#edit_script|Edit the file and replace the values in question]].
** if there are more usernames just repeat the steps from '''Edit the file and replace the values in question'''.
Anonymous user