Split large Git repository into many smaller ones

前端 未结 5 2110
故里飘歌
故里飘歌 2020-11-27 10:12

After successfully converting an SVN repository to Git, I now have a very large Git repository that I want to break down into multiple smaller repositories and maintain hist

5条回答
  •  广开言路
    2020-11-27 10:20

    The git_split project is a simple script that does exactly what you are looking for. https://github.com/vangorra/git_split

    Turn git directories into their very own repositories in their own location. No subtree funny business. This script will take an existing directory in your git repository and turn that directory into an independent repository of its own. Along the way, it will copy over the entire change history for the directory you provided.

    ./git_split.sh    
            src_repo  - The source repo to pull from.
            src_branch - The branch of the source repo to pull from. (usually master)
            relative_dir_path   - Relative path of the directory in the source repo to split.
            dest_repo - The repo to push to.
    

提交回复
热议问题