need help stripping a repo to one file

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

need help stripping a repo to one file

From: Caleb Cushing <hidden>
Date: 2016-06-15 22:45:30

here's what I've done so far (note: this is a public repo if anyone
wants to take a look)

git clone git@github.com:xenoterracide/dot_usr.git sql_iabbr
cd sql_iabbr/
git checkout db3c5ffb180f10dde8e539a81a6644760e098dcd
git branch -D master
git checkout -b master
git filter-branch --subdirectory-filter  vim/ftplugin/ -- --all


that leaves me with this
html  sgml  sh  tex  vim  xhtml  xml  sql_iabbr.vim  xml.vim

all I want left is sql_iabbr.vim and it's history

I've used stuff like
git filter-branch --tree-filter 'rm -rf xml.vim' HEAD

to remove the files... but I notice that leaves the logs.

I'm thinking I could do that and then remove those commits but I
haven't figured out how to remove the commits, and even then I'm not
sure the repo would be in the state I want.

can anyone help me get to where I want to be? also is there an easier
way to do what I've done so far?
-- 
Caleb Cushing

Re: need help stripping a repo to one file

From: Baz <hidden>
Date: 2016-06-15 22:45:30

2008/10/19 Caleb Cushing [off-list ref]:
here's what I've done so far (note: this is a public repo if anyone
wants to take a look)

git clone git@github.com:xenoterracide/dot_usr.git sql_iabbr
cd sql_iabbr/
git checkout db3c5ffb180f10dde8e539a81a6644760e098dcd
git branch -D master
git checkout -b master
git filter-branch --subdirectory-filter  vim/ftplugin/ -- --all


that leaves me with this
html  sgml  sh  tex  vim  xhtml  xml  sql_iabbr.vim  xml.vim

all I want left is sql_iabbr.vim and it's history
So you just want the history for a single file?

 git log -p --reverse --pretty=email -- sql_iabbr.vim

That outputs a patch history for sql_iabbr.vim in mbox format, you can
import that into an empty repo with git-am.

(I had a look at the project, the history is simple with no merges
etc, so nothing like --first-parent is needed)

Cheers,
Baz
I've used stuff like
git filter-branch --tree-filter 'rm -rf xml.vim' HEAD

to remove the files... but I notice that leaves the logs.

I'm thinking I could do that and then remove those commits but I
haven't figured out how to remove the commits, and even then I'm not
sure the repo would be in the state I want.

can anyone help me get to where I want to be? also is there an easier
way to do what I've done so far?
--
Caleb Cushing
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help