{"thread":{"id":"15966","subject":"need help stripping a repo to one file","startedAt":"2008-10-19T10:27:35Z","lastAt":"2008-10-20T11:53:04Z","messageCount":2,"participants":["Caleb Cushing","Baz"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"93438","messageId":"81bfc67a0810190327i7842d346g4c20f5816e8a9eda@mail.gmail.com","threadId":"15966","inReplyTo":null,"subject":"need help stripping a repo to one file","fromName":"Caleb Cushing","fromEmail":"xenoterracide@gmail.com","sentAt":"2008-10-19T10:27:35Z","receivedAt":"2008-10-19T10:27:35Z","isPatch":false,"sender":{"key":"xenoterracide@gmail.com","avatar":"https://gravatar.com/avatar/af3f0745dfa0ea9c4ee551d7d0a3cfe7ba8d229754c11678ab2ed23c3fa57065?d=mp&s=160"},"body":"here's what I've done so far (note: this is a public repo if anyone\nwants to take a look)\n\ngit clone git@github.com:xenoterracide/dot_usr.git sql_iabbr\ncd sql_iabbr/\ngit checkout db3c5ffb180f10dde8e539a81a6644760e098dcd\ngit branch -D master\ngit checkout -b master\ngit filter-branch --subdirectory-filter  vim/ftplugin/ -- --all\n\n\nthat leaves me with this\nhtml  sgml  sh  tex  vim  xhtml  xml  sql_iabbr.vim  xml.vim\n\nall I want left is sql_iabbr.vim and it's history\n\nI've used stuff like\ngit filter-branch --tree-filter 'rm -rf xml.vim' HEAD\n\nto remove the files... but I notice that leaves the logs.\n\nI'm thinking I could do that and then remove those commits but I\nhaven't figured out how to remove the commits, and even then I'm not\nsure the repo would be in the state I want.\n\ncan anyone help me get to where I want to be? also is there an easier\nway to do what I've done so far?\n-- \nCaleb Cushing\n"},{"id":"93503","messageId":"2faad3050810200453o231d9702i6856657b925dd332@mail.gmail.com","threadId":"15966","inReplyTo":"81bfc67a0810190327i7842d346g4c20f5816e8a9eda@mail.gmail.com","subject":"Re: need help stripping a repo to one file","fromName":"Baz","fromEmail":"brian.ewins@gmail.com","sentAt":"2008-10-20T11:53:04Z","receivedAt":"2008-10-20T11:53:04Z","isPatch":false,"sender":{"key":"brian.ewins@gmail.com","avatar":"https://gravatar.com/avatar/9ac03d89105e50a7151e695a1b4b1228151064ec3ac380a73b74ab397796baf7?d=mp&s=160"},"body":"2008/10/19 Caleb Cushing <xenoterracide@gmail.com>:\n> here's what I've done so far (note: this is a public repo if anyone\n> wants to take a look)\n>\n> git clone git@github.com:xenoterracide/dot_usr.git sql_iabbr\n> cd sql_iabbr/\n> git checkout db3c5ffb180f10dde8e539a81a6644760e098dcd\n> git branch -D master\n> git checkout -b master\n> git filter-branch --subdirectory-filter  vim/ftplugin/ -- --all\n>\n>\n> that leaves me with this\n> html  sgml  sh  tex  vim  xhtml  xml  sql_iabbr.vim  xml.vim\n>\n> all I want left is sql_iabbr.vim and it's history\n\nSo you just want the history for a single file?\n\n git log -p --reverse --pretty=email -- sql_iabbr.vim\n\nThat outputs a patch history for sql_iabbr.vim in mbox format, you can\nimport that into an empty repo with git-am.\n\n(I had a look at the project, the history is simple with no merges\netc, so nothing like --first-parent is needed)\n\nCheers,\nBaz\n\n>\n> I've used stuff like\n> git filter-branch --tree-filter 'rm -rf xml.vim' HEAD\n>\n> to remove the files... but I notice that leaves the logs.\n>\n> I'm thinking I could do that and then remove those commits but I\n> haven't figured out how to remove the commits, and even then I'm not\n> sure the repo would be in the state I want.\n>\n> can anyone help me get to where I want to be? also is there an easier\n> way to do what I've done so far?\n> --\n> Caleb Cushing\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"}]}