I imported a Bazaar repository into Git (using git bzr), but the resulting repository contains a spurious commit parent link:
The easiest way to do this (in git >= 1.6.5) is to use:
git replace --edit
and remove/add/change the Parent: lines.
Once you are happy the change is right, you can rewrite the commits to make the change permanent:
git filter-branch --tag-name-filter cat -- --all
In some cases it'll be noticeably quicker to only rewrite the commits involved and not the full history (thanks to Michael for mentioning this in the comments); e.g. to rewrite only commits on the current branch:
git filter-branch --tag-name-filter cat -- ..head
If you're not sure, use --all, otherwise you risk ending up with other branches/tags still referencing the temporary replacement object.