{"thread":{"id":"10014","subject":"Re: Q: howto rebase","startedAt":"2007-09-25T14:54:33Z","lastAt":"2007-09-25T14:54:33Z","messageCount":1,"participants":["lode leroy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"54002","messageId":"b41dbf4a0709250754o189d99fcn4767b37b9ebbdf06@mail.gmail.com","threadId":"10014","inReplyTo":"b41dbf4a0709250748l52b64155k65b6adb16e8dbcd5@mail.gmail.com","subject":"Re: Q: howto rebase","fromName":"lode leroy","fromEmail":"lode.leroy@gmail.com","sentAt":"2007-09-25T14:54:33Z","receivedAt":"2007-09-25T14:54:33Z","isPatch":false,"sender":{"key":"lode.leroy@gmail.com","avatar":null},"body":"I'm trying to understand how rebase works, but I need some help to get it.\nSuppose I do the following workflow... (see below)\n\nIn \"version B\" I introduce the \"fix c\", but in \"version D\" I realize\nit should have\nbeen in some other place. (commit D moves the fix to its proper place).\nA-B-C-D-E\n\nNow I want to 'rewrite history'.\nI would like to move commit D after B\nA-B-D'-C'-E\n\nand then fold the commits B and D' into a single commit.\nA-B'-C'-E\n\nI somehow managed to get this done using \"rebase -i\"\nby exchanging the 2 appropriate lines, and then deleting the second one,\nbut I'd like to understand how to do this from the command line...\n\nCould anyone enlighten me? I've read git-rebase(1) several times,\nbut don't seem to get it right...\n\n\ncat > file <<EOF\na\nb\nd\ne\ng\nh\nEOF\ngit add file\ngit commit -m 'A' -a\ncat > file <<EOF\na\nb\nd\ne\ng\nc\nh\nEOF\ngit commit -m 'B' -a\ncat > file <<EOF\na\nb\nd\ne\nf\ng\nc\nh\nEOF\ngit commit -m 'C' -a\ncat > file <<EOF\na\nb\nc\nd\ne\nf\ng\nh\nEOF\ngit commit -m 'D' -a\ncat > file <<EOF\na\nb\nc\nd\ne\nf\ng\nh\ni\nEOF\ngit commit -m 'E' -a\n"}]}