Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 23
    I think the confusion is the phrase "read the desired tree into the index". Commented Oct 2, 2008 at 2:30
  • 4
    If you want to export directory foo in branch bar, then this would be git read-tree bar:foo And then git checkout-index --prefix=export_dir/ -a after that maybe you should do git update-index master Commented Jun 8, 2012 at 17:10
  • 3
    @JohnWeldon Does it require you to clone the repo first? If so, then I wouldn't accept it, since the whole point of "svn export" of a subdirectory is to directly get a copy of that subdirectory; if someone has a 1GB Git repo and all I want is a 10kB subdirectory, it's insane to require me to clone the whole thing. Commented May 31, 2017 at 16:44
  • 7
    Also I'd echo @davetron5000 with the comment "read the desired tree into the index" which I have no idea what it means. Commented May 31, 2017 at 16:44