Convert the SVN repository to GitLab: Difference between revisions

From Apoyar Wiki
Jump to navigation Jump to search
(SVN to Git - adding content)
(No difference)

Revision as of 16:21, 13 February 2017

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.

  • SSH to phobos.apoyar This server is reserved for maintenance/support and has all relevant software installed.
  • 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:
  • 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.
  • Push to GitLab:
  • GitLab will now show all commits and files of the repository. Only master branch will exist
  • if there is a non-existing user(s) in commits:
    • Open the project in GitLab
    • Browse through the commits
    • Copy and paste all user emails you found to text file
    • 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.
    • Edit the file and replace the following values with their current ones:.
      • OLD_EMAIL=" "
      • CORRECT_NAME=" "
      • CORRECT_EMAIL
    • Run ./git-author-rewrite.sh
    • Push the changes over:
      • git push --force --tags origin 'refs/heads/*'
    • check whether it’s OK
    • delete the backup:
      • git update-ref -d refs/original/refs/heads/master
    • if there are more usernames just repeat the steps from Edit the file and replace the values in question.