Skip to content

Instantly share code, notes, and snippets.

@mvneves
mvneves / git-split.md
Created December 28, 2017 21:36
How to split a git repository into two different ones

How to split a git repository into two different ones

These are the steps to extract a directory from a git repository (with all its history commit), create a new repository from this directory, and optionally remove it from the original one.

To the ones that are here to copy-paste code, this is an example which removes the MODULE directory from REPO repository.

Step 1: Extract the directory from the git repository

Clone the original repository: