I recently migrated a repository to git from svn. When I look at the log, all the commits from SVN are not properly formatted in the 50/72 format. Is there a way that I can go through every commit message and edit it so that it conforms to git format?
You said in a comment:
The repository was migrated over a week ago and already has commits on it made in Git.
As such, the best option is to simply live with it and keep making correct commit messages from now on.
All methods that would change the commit messages in those old commits would change the commits and create completely new objects with different IDs. As such the repositories of everyone who is already working with it would break, requiring them to manually reset to the new, rewritten state of the repository.
That ends just in a lot more work (and confusion!) than necessary for the trivial matter of commits with a non-perfect commit message which were migrated from an old system. I think it’s perfectly fine to have some old history, from the days before, which does not fit perfectly into the current standards. You wouldn’t rewrite all commits if you later decide to change your code formatting rules either.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With