{"thread":{"id":"24549","subject":"removing very old commits (including initial)","startedAt":"2010-07-28T08:53:09Z","lastAt":"2010-07-28T09:10:48Z","messageCount":3,"participants":["Mihamina Rakotomandimby","Ævar Arnfjörð Bjarmason","Santi Béjar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"146595","messageId":"20100728115309.08ed6fdd@packard.rktmb.org","threadId":"24549","inReplyTo":null,"subject":"removing very old commits (including initial)","fromName":"Mihamina Rakotomandimby","fromEmail":"mihamina@gulfsat.mg","sentAt":"2010-07-28T08:53:09Z","receivedAt":"2010-07-28T08:53:09Z","isPatch":false,"sender":{"key":"mihamina@gulfsat.mg","avatar":null},"body":"Manao ahoana, Hello, Bonjour,\n\nI work on a personnal project that become a little bit bigger over the\ntime.\nInitially, it was a single file one, and that file contained database\ncredentials.\nLater, I splat the project and put the credentials in another untracked\nfile (.gitignore).\nWhen I want to publish this project, the history contains the initial\nfile, with the credentials. I dont want to publish that.\n\nIt's not a problem to definitely wipe the \"single file\" part of history\nof this project, but interesting to keep the history after the\nsplit&untracking.\n\nHow to?\nPublishing will be through gitweb.\n\nMisaotra, Thanks, Merci.\n\n-- \n\n       Architecte Informatique chez Blueline/Gulfsat:\n    Administration Systeme, Recherche & Developpement\n                                    +261 34 56 000 19\n"},{"id":"146596","messageId":"AANLkTikyN1yHEj+jS0JRbjO+uX4mo0sfQs13_YfTD13_@mail.gmail.com","threadId":"24549","inReplyTo":"20100728115309.08ed6fdd@packard.rktmb.org","subject":"Re: removing very old commits (including initial)","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-28T09:10:19Z","receivedAt":"2010-07-28T09:10:19Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Wed, Jul 28, 2010 at 08:53, Mihamina Rakotomandimby\n<mihamina@gulfsat.mg> wrote:\n\n> It's not a problem to definitely wipe the \"single file\" part of history\n> of this project, but interesting to keep the history after the\n> split&untracking.\n\ngit-filter-branch(1) will do everything you need.\n"},{"id":"146597","messageId":"AANLkTim7yLFXZ8hgH1=agq2Qi7TUFk=348Pxb=SB67dm@mail.gmail.com","threadId":"24549","inReplyTo":"20100728115309.08ed6fdd@packard.rktmb.org","subject":"Re: removing very old commits (including initial)","fromName":"Santi Béjar","fromEmail":"santi@agolina.net","sentAt":"2010-07-28T09:10:48Z","receivedAt":"2010-07-28T09:10:48Z","isPatch":false,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Wed, Jul 28, 2010 at 10:53 AM, Mihamina Rakotomandimby\n<mihamina@gulfsat.mg> wrote:\n> Manao ahoana, Hello, Bonjour,\n>\n> I work on a personnal project that become a little bit bigger over the\n> time.\n> Initially, it was a single file one, and that file contained database\n> credentials.\n> Later, I splat the project and put the credentials in another untracked\n> file (.gitignore).\n> When I want to publish this project, the history contains the initial\n> file, with the credentials. I dont want to publish that.\n>\n> It's not a problem to definitely wipe the \"single file\" part of history\n> of this project, but interesting to keep the history after the\n> split&untracking.\n\nIf I understand you correctly you want to publish only the commits\nsince a particular commit, say \"newroot\". You can do it with \"git\nfilter-branch\". You have many different filters, but in you case I\nwould you grafts to cut the history and the rewrite the history with\ngit filter-branch.\n\nIn .git/info/grafts you put something like this:\nHashOfTheNewRoot\n\nIt means that this commit has no parent, so you are cutting the\nhistory. You can examine the history with git log or gitk to check\neverything looks fine. To make it definitive you have to execute git\nfilter-branch:\n\n$ git filter-branch -- --all\n\n--all in this case means all the refs.\n\nHTH,\nSanti\n>\n> How to?\n> Publishing will be through gitweb.\n>\n> Misaotra, Thanks, Merci.\n>\n> --\n>\n>       Architecte Informatique chez Blueline/Gulfsat:\n>    Administration Systeme, Recherche & Developpement\n>                                    +261 34 56 000 19\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"}]}