GitHub Migration

GitHub is a great collaborative development platform for Open Source. My projects were currently only published in source zip files, and my SVN repository was private. Having played a while with GitHub, this is now a must have if you want some contributions. So I decided to publish my projects to GitHub.

But I had some exigences :

  • Keep separate a ‘private’ repository and the GitHub public one : I use a repository to sync files between my Linux and Windows development environments with a lot of technical commits
  • Have history commits (but cleaned of those technical commits and rubbish comments)

As I use SVN for my private repository, it is very easy to distinguish from git commits. And both tools perfectly works alongside each other.

To migrate contents, I wrote two scripts, inspired by this article about GIT commits in the past : https://leewc.com/articles/making-past-git-commits/

Migration from Files

The first one is for projects for which I have kepts history of source files

Note that the files removed in files are not removed. If you want to, uncomment rm -Rf items, at your own risk. I prefered a cleanup commit at the end.

Once finished, you may push to an uninitialized repository at GitHub.

You may also move the .git repository created at your current repository, and commit extra changes.

Migration from SVN

There is a lot of great tools to migrate SVN to GIT, but I found no one that could merge some commits to have a clean history. Too bad it is not supported by SVN or GIT.
So I decided to select some revisions to build GIT history.

With this method deleted items are handled ok. No need of a cleanup commit. You may move the .git folder to your repository and push extra changes.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close Menu