From: Thomas Rast Date: Tue, 18 Dec 2012 14:31:03 GMT Subject: Re: [BUG] Cannot push some grafted branches Message-ID: <87txrjsa8o.fsf@pctrast.inf.ethz.ch> In-Reply-To: <20121218144157.00ccd915@chalon.bertin.fr> Yann Dirson writes: >> +EXAMPLE >> +------- >> + >> +Replacements (and before them, grafts) are often used to replace the >> +parent list of a commit. Since commits are stored in a human-readable >> +format, you can in fact change any property using the following >> +recipe: >> + >> +------------------------------------------------ >> +$ git cat-file commit original_commit >tmp >> +$ vi tmp >> +------------------------------------------------ >> +In the editor, adjust the commit as needed. For example, you can edit >> +the parent lists by adding/removing lines starting with "parent". >> +When done, replace the original commit with the edited one: >> +------------------------------------------------ >> +$ git replace original_commit $(git hash-object -w tmp) > > You probably meant "-t commit" - a sign that it's not so trivial to forge ? Mostly a sign that despite my testing efforts, I still fail at cut&paste... But yes, it absolutely needs -t commit. Otherwise the commit would be replaced by a blob, and confusion ensues. -- Thomas Rast trast@{inf,student}.ethz.ch