A nodejs cli tool to split monolithic GIT repository
For more information on monolithic repositories :
- https://gist.github.com/arschles/5d7ba90495eb50fa04fc
- http://gregoryszorc.com/blog/2014/09/09/on-monolithic-repositories/
- https://danluu.com/monorepo/
- http://www.thedotpost.com/2016/05/fabien-potencier-monolithic-repositories-vs-many-repositories
See https://www.npmjs.com/package/gitsplitter
- Git ~1.8
- NodeJS ~6.0.0
npm install -g gitsplitter
On unix system you have to re-define file type with dos2unix tool (will be fixed soon 😇):
wich gitsplitter
dos2unix /path/to/gitsplitter/exec
Create a gitsplit.json configuration file in root of you monolithic repository :
{
"temp_path": "/tmp/gitsplitter/",
"clean_temp_folder": true,
"source_repository": "git@github.com:pushreset/my_monolithic_repo.git",
"master_branch": "master",
"default_branch": "master",
"allow_push_force": true,
"push_force_on_master": false,
"folders" : {
"folder_a": {
"name": "folder_a",
"target_repository": "git@github.com:pushreset/my_splitted_repo_folder_a.git"
},
"folder_b": {
"name": "folder_b",
"target_repository": "git@github.com:pushreset/my_splitted_repo_folder_b.git"
}
}
}
❗ BE CAREFUL THIS TOOL IS MAKING GIT PUSH FORCE ON DESTINATION REPOSITORIES ❗
On root of you monolithic repository :
gitsplitter
or
gitsplitter --branch=feat/awesome --folders=folder_a,folder_b --verbose
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Julien Duvignau