I would like to rewrite the history of one of my repo programatically, for example using gitpython. The idea is to read a existing repository, and reapply each of its commits to a new one, after some modification:
- different commiting time
- splitting some commit to a submodule, if files match some pattern, adding a reference to the submodule commit
- use a different commit message
Using gitpython, I can read the commit history tree and all the relevant informations, but I haven't found a way to commit something on a new repo, no more success when the information must be copied from another repo.
Is there a way to do this programatically? I imagine there must be a way, as it can be done more or less by hand, one commit by one.
Many thanks!