[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

SVN to Git migration script for pkg-java

Hi all,

I prepared a script to migrate a package from SVN to Git. I tested it on
a couple of packages and it seems to work fine. The script is available
on alioth at:


Migrating a package is as simple as typing:

    ./migrate-svn-repo-to-git <packagename>

This will perform the following tasks:
- Clone the SVN repository using git-svn into a new Git repository. The
history is preserved with the exact author names and tags.
- Create an upstream branch such that the package can then be maintained
with git-buildpackage (git-import-orig will work out of the box)
- Update the Vcs-* fields in debian/control
- Add an entry in debian/changelog mentioning the migration
- Push the new Git repository on alioth under pkg-java
- Add a MOVED_TO_GIT.txt file in the SVN repository containing the
location of the new repository.

The last two steps are optional, the user is prompted before executing
them. I usually run the script once without publishing anything and
check if the history is fine. I then restart and push the changes. The
old packages who migrated from CVS tend to have weird tag names that
need to be corrected manually.

Feel free to modify the script if you want to improve it.

Disclaimer: I don't plan to start a mass migration of our packages, I'm
aware not everyone likes Git and this would be very time consuming to do
it right. But at least if someone want to migrate its package we now
have a tool do to is consistently across the team.

Emmanuel Bourg

Reply to: