User:Llocsin

From SCECpedia
Jump to navigationJump to search

SVN to Git Plan

Convert SVN repository to a Git Repository.

Steps:

  1. Download svn2git tool: https://github.com/nirvdrum/svn2git
    1. Add Commands
  2. Pull desired SVN repository
    1. //Add Commands
  3. Create Text Document of Authors to link to Git Accounts
    1. create authors.txt
    2. add in all authors with the following format:
      1. jcoglan = James Coglan <jcoglan@never-you-mind.com>
      2. stnick = Santa Claus <nicholas@lapland.com> (Recommended to link everyone’s account but if you can’t, it’s not required to link everyone’s account, but you must provide an email, if only a made up one.)
  4. Convert the repositories with the git commands:
    1. $ svn2git http://source.usc.edu/svn/mesh_partitioner/ --trunk trunk --tags tags --nobranches --authors ~/authors.txt (Note: --trunk trunk (the trunk argument is the name of the trunk repository-tags tags (tags is the name of your repository of tags))
  5. Push to the desired git remote. (In this example we use github)
    1. Add Remote
      1. git remote add <remote-name> <remote-url>##git remote origin git@github.com:SCECcode/CyberShake.git
    2. Commit
      1. git add .
      2. git commit -m “Initial Commit of Converted SVN to Git Repository Code”
    3. Use tags command
      1. git push --tags


Resources:

  1. svn2git tool (from the guide): https://github.com/nirvdrum/svn2git
  2. Official Git Documentation:
  3. Guide: https://viastudio.com/migrate-svn-git/: https://github.github.com/training-kit/downloads/subversion-migration/
  4. Github Importer Tool (alternate): https://docs.github.com/en/github/importing-your-projects-to-github/about-github-importer