Transferring SVN Repositories to Git

Adapted from documentation by leeor_net and Hooman in the Outpost Universe forums

If you are looking to transfer a SVN repository entry that does not contain a trunk/tags/branches to Git:

Ensure any proprietary information is removed from the repository. They may be filtered out to remove the files from both the HEAD revision and all previous commits, ensuring there is no remaining traces in the repository.

The conversion steps were:

mkdir OP2MapImager
cd OP2MapImager/
git svn init $removed_url_to_OP2MapImager
git svn fetch
git filter-branch --tree-filter "rm -f OP2MapImager/*.bmp" --prune-empty HEAD
git filter-branch -f --tree-filter "rm -rf OP2MapImager/TestFiles/" --prune-empty HEAD

To upload the results to GitHub, a GitHub repository needs to be created first. This can be done from the GitHub website.

To upload the contents of the local repository to the new empty GitHub repository:

git remote add origin https://github.com/OutpostUniverse/OP2MapImager.git
git push -u origin master

- Go Back to Outpost Universe Repositories
- Go Back to Wiki Home Page

  • opu/repositories/svntogit.txt
  • Last modified: 2021/01/05 07:51
  • by blackbox222