Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 04:58 Go to next message
Jack Poon is currently offline Jack PoonFriend
Messages: 1
Registered: June 2016
Junior Member
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 08:47 Go to previous message
Christian Halstrick is currently offline Christian HalstrickFriend
Messages: 267
Registered: July 2009
Senior Member
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.


Previous Topic:Delete a repo after cloning
Next Topic:EGit API documentation (javadoc)
Goto Forum:

Current Time: Fri Feb 21 19:38:24 GMT 2020

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

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

Back to the top