Estimated read time: 1 minutes
git-1.5.6 will be released soon (probably in a few weeks) and there are some interesting news in it.
one of them is the new git cvsimport -W switch which makes it easy to do bi-directional changes between git and cvs.
to set up your local repo:
$ CVSROOT=$URL cvs co module $ cd module $ git cvsimport
this will do a fresh checkout of the cvs module and will import it to git. you will have two interesting git branch: origin is the "reference" one, you should not touch it, and you can work in master.
you can commit to master, etc.
then there are two tricky operations:
first, you may want to commit back your local commits.
to do this:
$ for i in $(git rev-list --reverse origin..master) do git cvsexportcommit -W -c -p -u $i done
second, you may want to fetch upstream changes and rebase your local changes on top of them:
$ git cvsimport -i $ git rebase origin
cookies goes to Dscho in commit d775734. :)