Once the move from Subversion to Git occurs, it will be difficult for your changes to local checkouts of the SVN trunk to be transitioned into Git. However, you can make it much easier by committing your changes to a personal branch of the Subversion repository prior to the transition. This is the easiest process for getting your changes transitioned to Git. Follow the steps below to create a new branch that contains your changes:

  1. Create a new branch using svn copy. I suggest something descriptive like "SVN_to_GIT_branch_kavulich"

    svn copy -m 'Creating branch for Git transition' https://svn-wrf-model.cgd.ucar.edu/trunk https://svn-wrf-model.cgd.ucar.edu/branches/SVN_to_GIT_branch_kavulich

    NOTE: If your changes are based on a much older version of the trunk, you may want to create your branch from the same revision number as your current revision. You can find your revision number with "svn info".

    svn copy -r8350 -m 'Creating branch for Git transition based off revision number 8350 of the trunk' https://svn-wrf-model.cgd.ucar.edu/trunk https://svn-wrf-model.cgd.ucar.edu/branches/SVN_to_GIT_branch_kavulich
  2. Enter the directory which is your local copy of the SVN trunk with the changes you wish to save. 

    cd /Users/kavulich/my_changes/trunk
    svn status
    M Registry/registry.var
    M inc/version_decl

  3. Use the "svn switch" command to convert your local "trunk" copy into a copy of this new branch. Your local changes will be preserved. If you receive any alerts about conflicts, be sure to select "mine-conflict" to keep your changes.

    svn switch https://svn-wrf-model.cgd.ucar.edu/branches/SVN_to_GIT_branch_kavulich
    svn status
    M Registry/registry.var
    M inc/version_decl
     
  4. Use "svn commit" to commit your changes to this branch

    svn commit -m 'Committing changes to my branch for the Git transition'

     

Your local changes are now in a branch, and will be transitioned along with the rest of the repository into github!

 

 

  • No labels