Git subtree split two directories

前端 未结 3 1619
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-02 02:50

I\'ve been following this excellent answer to extract a subdirectory of my git repository into its own repository, while retaining the complete history.

My repositor

3条回答
  •  星月不相逢
    2021-01-02 03:34

    Use git-filter-repo This is not part of git as of version 2.25. This requires Python3 (>=3.5) and git 2.22.0

    git filter-repo --path src/math --path tests/math 
    

    For my repo that contained ~12000 commits git-filter-branch took more than 24 hours and git-filter-repo took less than a minute.

提交回复
热议问题