Maintaining Git History when Spinning Out a Subdirectory

A quick summary of how to maintain git history when moving a subdirectory of a larger project out into its own repository, e.g. when open sourcing a monorepo component.