Problem : One part of a git-tracked repo has become an independent project in its own right. Moreover, there’s no need for participants in that project to have access to the rest of the repo.

Idea : Move the independent project out into a separate git repo, preserving all the commit history.

Huge props to the following :

Initially : Create a fresh clone of the source repo (this will be removed later : don’t do this on a working copy, just in case everything goes awry):

Now, let’s filter everything in the directory ‘android-edutiger’ out of this local copy - all the changes from here are what will be moved across (disconnect from the main repo) :

Now, tidying up the ‘source’ of the code prior to pulling it into the other repo, create a new directory, and move all the relevant files into it :

Using a (potentially) new repo (potentially on GitHub) and cloning it down to the local directory (let’s call it separated-out).

Now go into the repo separated-out and pull the stuff over from the local remote (which we’ll temporarily name SKETCHPAD) :

Now the new files should have arrived - disconnect from the local remote “SKETCHPAD”, and clean up:

Get rid of the hacked around ‘sketchpad’ (and a real working version will now need to have the same stuff cleaned out too, first-off by issuing a git pull) :