Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » Change a commit message or timestamop(How to modify a commit message or timestamp)
Change a commit message or timestamop [message #1735054] Wed, 15 June 2016 00:58 Go to next message
Eclipse UserFriend
I want to be able to modify the message, PersonIdent, and other fields for the entire repository for all commits. How to do that programmatically? Will that affect the parent / child / tree hash?

Re: Change a commit message or timestamop [message #1735303 is a reply to message #1735054] Fri, 17 June 2016 04:47 Go to previous message
Eclipse UserFriend
You can't modify a commit. You can only create a copy of a commit and choose to use different commit metadata and/or content for the copy. If you only choose to have different commit message, PersonIdent on your copy then the copied commit will have a different commit id. tree hashes will be the same on original and copied commit. If original commit had kids and you want to stay with the original topology then you have to create copies of the child commits also modifying their parentid to point to your new copy. Tools like (git filter-branch or [1] ) help you in this complicated process. Be aware that if you do that to a shared repo then all other developers will have problems merging in their commits which are based on the old commit ids.

[1] https://rtyley.github.io/bfg-repo-cleaner/
Previous Topic:Delete a repo after cloning
Next Topic:EGit API documentation (javadoc)
Goto Forum:
  


Current Time: Tue Jul 01 15:39:23 EDT 2025

Powered by FUDForum. Page generated in 0.03232 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top