1

I would like to release a small subset of a somewhat large software project I have been working on. I had released the full project as a compressed archive. I now want to release the small subset on GitHub.com.

What is the mechanism within git for packaging a subset of one's code and sharing that independent subset on a git web host? I wrote a script to extract the relevant files outside of the full project, but, needless to say, I do not want to put the files after extraction under git.

Edit replaced "git web host" with "GitHub.com" for more concreteness.

Calaf
  • 10,113
  • 15
  • 57
  • 120

1 Answers1

0

Probably you should turn your subset into a submodule which would be a published project (if I parse the "git web host" properly). You could extract it form your existing repo using git-subtree. Then you will probably need to run git filter-branch on your existing repo to wipe the subset extracted with git-subtree out of the "main" history; see this answer for more info.

P.S. Note that since some version git-subtree is now a part of Git (in its contrib/ directory, IIUC).

Community
  • 1
  • 1
kostix
  • 51,517
  • 14
  • 93
  • 176
  • Let me confirm that I understand. Were the small subset to be a subdirectory, the problem would be easy. A submodule would do. But if the subset consists of scattered directories throughout the parent/larger project, one must use git-subtree to extract that subset first. Is that close? – Calaf May 29 '12 at 13:25
  • git-subtree also can operate only on subdirectories. I supposed you have your code to become published localized in a subdirectory hence I proposed to use `git-subtree split` to extract it (with history) and publish, and then use `git filter-branch` to yank out that subdirectory (with its history) out of the original repo. If you have your code to be published scattered across the whole repository I'm afraid you might be out of luck. Is it possible to refactor the structure? – kostix May 29 '12 at 13:57
  • Bummer.. I could refactor the larger project, but it is a library, and refactoring can only be done at the price of making the directory structure of that library illogical. One more hope would be to uncover some form of (soft) symlinking in git. – Calaf May 29 '12 at 16:24