Git and Subsets of Files

Dylan Kinnett dylan at nocategories.net
Tue Oct 1 00:11:12 CEST 2013


I put this question forward on Ask Metafilter as well, and I got an
interesting way to do this. I thought I would share. (
http://ask.metafilter.com/249100/Can-a-Git-Branch-Contain-Only-a-Sub-Set-of-the-Repository)

The method involves first creating a branch to contain the "subset" of
files. In that branch, delete anything that isn't part of the subset, make
changes, etc. Then, using the "ours" merge strategy, merge the "subset"
branch back into master. This will only update master's copy of the changed
files but will not delete the files that were not part of the subset. I'm
not yet sure what might happen with newly added files and will have to try
that.

Although this involves an early-stage deletion of lots of files (in my
case) it seems like a good workflow, since Git for Windows doesn't handle
symlinks easily.


More information about the vcs-home mailing list