From: Jakub Narebski Date: Sat, 11 Nov 2006 11:56:19 GMT Subject: Re: check if a commit is ascendent of a specific commit Message-ID: <200611111256.20157.jnareb@gmail.com> In-Reply-To: Dnia sobota 11. listopada 2006 12:31, Nguyen Thai Ngoc Duy napisaƂ: > On 11/11/06, Jakub Narebski wrote: >> You can only amend topmost commit in any branch. Anything else would >> be rewriting history, starting from amended commit upwards in lineage >> (parentage). > > Yes. That's what I want. I am tempted to edit older commits just > because I forgot to add some entries to .gitignore that I should have > added sooner :-) In pure git you would have to create new branch at the commit you want to amend, amend the commit (in this branch), and rebase (or cherry-pick if you need to edit other commits too) the rest, then rename branch. Or if you don't want ot loose reflog, tag/branch current branch, then reset (rewind) current branch to the commit you want to amend, then cherry-pick. Or you can use cg-admin-rewritehist tool from Cogito. See: http://git.or.cz/gitwiki/GitTips -- Jakub Narebski