Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Splitting up a mono git repository to logical units

Instructions

  1. Pick the folder you want separated out from entire repo
    git filter-branch --subdirectory-filter rainmaker/ -- HEAD


  2. Optionally remove few modules from previously applied filter, say if rainmaker folder has 7 modules out of which you need only 5
    git filter-branch -f --prune-empty --index-filter 'git rm --cached --ignore-unmatch egov-search-indexer/ *egov-mdms-service-depreciated/* ' HEAD


  3. Check if repo structure is as needed, check current remote
    git remote -v


  4. Configure new remote URL
    git remote set-url origin https://github.com/NEW-REPOSITORY-NAME.git


  5. Push to new repo
    git push -u origin master


It's normal for the above commands to run for an extended period, especially if the repo has a large history as it's rewriting the history.

https://help.github.com/en/articles/splitting-a-subfolder-out-into-a-new-repository

https://git-scm.com/docs/git-filter-branch



  • No labels