{"thread":{"id":"27248","subject":"removing a commit from a branch","startedAt":"2011-05-04T08:35:08Z","lastAt":"2011-05-05T18:59:28Z","messageCount":8,"participants":["Gergely Buday","Jeff King","Peter Krefting","Dirk Süsserott","Øyvind A. Holm"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"166999","messageId":"BANLkTimtpvVRU=1iCbrteyHixaWGuVKDjQ@mail.gmail.com","threadId":"27248","inReplyTo":null,"subject":"removing a commit from a branch","fromName":"Gergely Buday","fromEmail":"gbuday@gmail.com","sentAt":"2011-05-04T08:35:08Z","receivedAt":"2011-05-04T08:35:08Z","isPatch":false,"sender":{"key":"gbuday@gmail.com","avatar":null},"body":"Hi there,\n\nI have a problematic commit in a series of commits on a branch. It\ncontains adding a large binary file, which I would like to avoid to\npush to our main repository. How can I remove that from the series of\ncommits? A command-line solution, please, if possible.\n\nCheers\n\n- Gergely\n"},{"id":"167001","messageId":"20110504084502.GC8512@sigill.intra.peff.net","threadId":"27248","inReplyTo":"BANLkTimtpvVRU=1iCbrteyHixaWGuVKDjQ@mail.gmail.com","subject":"Re: removing a commit from a branch","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-05-04T08:45:02Z","receivedAt":"2011-05-04T08:45:02Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, May 04, 2011 at 10:35:08AM +0200, Gergely Buday wrote:\n\n> I have a problematic commit in a series of commits on a branch. It\n> contains adding a large binary file, which I would like to avoid to\n> push to our main repository. How can I remove that from the series of\n> commits? A command-line solution, please, if possible.\n\nRemoving it will involve rewriting history, which can create headaches\nfor people who have built on that history (they will need to rebase\ntheir commits on the rewritten history). But if that's OK, then the\ncommand you want is filter-branch. See \"git help filter-branch\"; in\nparticular, the EXAMPLES section contains commands to do exactly what\nyou want.\n\n-Peff\n"},{"id":"167004","messageId":"BANLkTi=pVMrK8PM8s9MagN12FxMZ_=uAVw@mail.gmail.com","threadId":"27248","inReplyTo":"20110504084502.GC8512@sigill.intra.peff.net","subject":"Re: removing a commit from a branch","fromName":"Gergely Buday","fromEmail":"gbuday@gmail.com","sentAt":"2011-05-04T08:55:01Z","receivedAt":"2011-05-04T08:55:01Z","isPatch":false,"sender":{"key":"gbuday@gmail.com","avatar":null},"body":"> Removing it will involve rewriting history, which can create headaches\n> for people who have built on that history (they will need to rebase\n> their commits on the rewritten history).\n\nI did not push to any other repo yet, so this should be OK.\n\n- Gergely\n"},{"id":"167005","messageId":"alpine.DEB.2.00.1105041014480.16939@ds9.cixit.se","threadId":"27248","inReplyTo":"BANLkTimtpvVRU=1iCbrteyHixaWGuVKDjQ@mail.gmail.com","subject":"Re: removing a commit from a branch","fromName":"Peter Krefting","fromEmail":"peter@softwolves.pp.se","sentAt":"2011-05-04T09:17:07Z","receivedAt":"2011-05-04T09:17:07Z","isPatch":false,"sender":{"key":"peter@softwolves.pp.se","avatar":"https://avatars.githubusercontent.com/u/990764?v=4"},"body":"Gergely Buday:\n\n> I have a problematic commit in a series of commits on a branch. It\n> contains adding a large binary file, which I would like to avoid to\n> push to our main repository. How can I remove that from the series of\n> commits? A command-line solution, please, if possible.\n\nIf the branch is simple (no merges and such), I'd use \"git rebase \n--interactive branchpoint\" (where \"branchpoint\" is where the branch is \nrooted), or \"git rebase --interactive problematic^\" (where \"problematic\" is \nthe commit you want to edit, note the trailing \"^\" to start from its parent \ncommit).\n\nThen change the \"pick\" for the problematic commit to \"edit\", run the rebase, \nfix up the commit by using \"git rm\" and \"git commit --amend\" when it pauses, \nand then let it finish using \"git rebase --continue\".\n\n\"git --help rebase\" for more information.\n\n-- \n\\\\// Peter - http://www.softwolves.pp.se/\n"},{"id":"167027","messageId":"4DC192A0.6010808@dirk.my1.cc","threadId":"27248","inReplyTo":"alpine.DEB.2.00.1105041014480.16939@ds9.cixit.se","subject":"Re: removing a commit from a branch","fromName":"Dirk Süsserott","fromEmail":"newsletter@dirk.my1.cc","sentAt":"2011-05-04T17:53:36Z","receivedAt":"2011-05-04T17:53:36Z","isPatch":false,"sender":{"key":"newsletter@dirk.my1.cc","avatar":null},"body":"Am 04.05.2011 11:17 schrieb Peter Krefting:\n> Gergely Buday:\n>\n>> I have a problematic commit in a series of commits on a branch. It\n>> contains adding a large binary file, which I would like to avoid to\n>> push to our main repository. How can I remove that from the series of\n>> commits? A command-line solution, please, if possible.\n>\n> If the branch is simple (no merges and such), I'd use \"git rebase\n> --interactive branchpoint\" (where \"branchpoint\" is where the branch is\n> rooted), or \"git rebase --interactive problematic^\" (where \"problematic\"\n> is the commit you want to edit, note the trailing \"^\" to start from its\n> parent commit).\n>\n> Then change the \"pick\" for the problematic commit to \"edit\", run the\n> rebase, fix up the commit by using \"git rm\" and \"git commit --amend\"\n> when it pauses, and then let it finish using \"git rebase --continue\".\n>\n> \"git --help rebase\" for more information.\n>\n\nIf your \"problematic\" commit contains only that \"large file\" and nothing \nelse, then you'd probably like to remove the whole commit instead of \nediting it (as Peter described). Just do:\n\n$ git rebase --interactive problematic^\n\nAgain, notice the ^ after \"problematic\"\n\nAn editor pops up with the history since problematic's parent, i.e. \n\"problematic\" is the first item in the list. Simply delete the line with \nthe \"problematic\" commit. It should be the first line. Save the file, \nexit the editor. That's it.\n\n     Dirk\n"},{"id":"167038","messageId":"4DC1A519.3070907@dirk.my1.cc","threadId":"27248","inReplyTo":"4DC192A0.6010808@dirk.my1.cc","subject":"Sorry, completely off-topic. I've a mailer problem (was: Re: removing a commit from a branch)","fromName":"Dirk Süsserott","fromEmail":"newsletter@dirk.my1.cc","sentAt":"2011-05-04T19:12:25Z","receivedAt":"2011-05-04T19:12:25Z","isPatch":false,"sender":{"key":"newsletter@dirk.my1.cc","avatar":null},"body":"Sorry, I know, this is no Thunderbird board, but I guess other people \nuse this client as well.\n\nWhen I write a message, it wraps at col 72 (or so). When I see my post \nin the list, it isn't wrapped at all. Only one long line per paragraph. \nThat's inconvenient for the list and I'd like to avoid that. How do YOU \ndo that?\n\nI'm using Mozilla Thunderbird 3.1.10 for Windows (which is the latest, I \nthink).\n\nAgain, I'm sorry about posing such an off-topic and non-git question, \nbut probably someone has the same prob (or -- even better -- has had \nresolved it).\n\nCheers,\n     Dirk\n"},{"id":"167046","messageId":"BANLkTi=CE3aTqN+eSDwRuqvioLYtHG-z_w@mail.gmail.com","threadId":"27248","inReplyTo":"4DC1A519.3070907@dirk.my1.cc","subject":"Re: Sorry, completely off-topic. I've a mailer problem (was: Re: removing a commit from a branch)","fromName":"Øyvind A. Holm","fromEmail":"sunny@sunbase.org","sentAt":"2011-05-04T21:28:57Z","receivedAt":"2011-05-04T21:28:57Z","isPatch":false,"sender":{"key":"sunny@sunbase.org","avatar":"https://avatars.githubusercontent.com/u/113445?v=4"},"body":"2011/5/4 Dirk Süsserott <newsletter@dirk.my1.cc>:\n> Sorry, I know, this is no Thunderbird board, but I guess other people\n> use this client as well.\n>\n> When I write a message, it wraps at col 72 (or so). When I see my post\n> in the list, it isn't wrapped at all. Only one long line per\n> paragraph. That's inconvenient for the list and I'd like to avoid\n> that. How do YOU do that?\n>\n> I'm using Mozilla Thunderbird 3.1.10 for Windows (which is the latest,\n> I think).\n>\n> Again, I'm sorry about posing such an off-topic and non-git question,\n> but probably someone has the same prob (or -- even better -- has had\n> resolved it).\n\nThere is a section on how to set up Thunderbird and other mail clients\nin Documentation/SubmittingPatches in the git.git repository which you\ncan read here:\n\n  http://repo.or.cz/w/git.git/blob_plain/HEAD:/Documentation/SubmittingPatches\n\nRegards,\nØyvind\n"},{"id":"167156","messageId":"4DC2F390.2040401@dirk.my1.cc","threadId":"27248","inReplyTo":"4DC1B103.90007@cisco.com","subject":"Re: Sorry, completely off-topic. I've a mailer problem","fromName":"Dirk Süsserott","fromEmail":"newsletter@dirk.my1.cc","sentAt":"2011-05-05T18:59:28Z","receivedAt":"2011-05-05T18:59:28Z","isPatch":false,"sender":{"key":"newsletter@dirk.my1.cc","avatar":null},"body":"Am 04.05.2011 22:03 schrieb Phil Hord:\n> On 05/04/2011 03:12 PM, Dirk Süsserott wrote:\n>> Sorry, I know, this is no Thunderbird board, but I guess other people\n>> use this client as well.\n>>\n>> When I write a message, it wraps at col 72 (or so). When I see my post\n>> in the list, it isn't wrapped at all. Only one long line per\n>> paragraph. That's inconvenient for the list and I'd like to avoid\n>> that. How do YOU do that?\n> \n> \n> Options > Format > Plain text only\n> \n> However, your emails are being sent wrapped as you see them originally.\n>   But in your email headers is this line:\n> \n> Content-Type: text/plain; charset=ISO-8859-1; format=flowed\n> \n> The \"format=flowed\" is convincing Thunderbird to unwrap your lines when\n> you view them in Thunderbird. The raw text of your emails look fine.\n> (In Thunderbird, examine the raw email with Ctrl-U.)\n> \n> More on f=f: http://joeclark.org/ffaq.html\n> \n> Phil\n> \n\nThank you, Phil and Øyvind,\n\nI now configured my Thunderbird to do it right (I hope). My next post\nwill tell ...\n\nDirk\n"}]}