When using git svn, a sparse checkout of the central repository may be achieved by something along the lines of
git clone -s URL-to-root --include-paths 'dir1|dir2|dir3'
After using this setup for some time, I would like to add another directory dir4 to those tracked. This directory has existed in many commits that I have already checked out. Editing the variable svn-remote.svn.include-paths by running
git config --edit
does not have the desired effect on git fetch
(only files changed in future commits will be checked out as they are changed; not immediately), and the following also does not check out dir4:
git svn fetch --include-paths dir4
I think the following would work but would be very ineffective due to refetching all revisions since the first revision at which dir4 appeared for the first time (let's call it REV):
git svn reset -r REV
git svn fetch --include-paths dir4
git svn rebase
What would be a better way of tracking dir4? What if I do not care about the history of dir4?
Is there a better way to do the initial sparse checkout with git-svn if I suspect I will want to change the list of tracked directories later? I have also tried starting by listing the directoreis that are not to be fetched in the original commit, but I do not know how to unignore them later:
git svn fetch --ignore-paths dir4
But how do I tell git to stop ignoring dir4
when I decide I want to check it out as well?