將大型 git project 的資料夾拆成小 git project 管理, 並保留對應的 commit log
sudo apt install git-filter-repo
– Clone large-size git project fitst
git clone REMOTE_GIT_REPOS_URL
– Filter out a subfolder from the repository and set the subfolder as new root folder
git filter-repo --subdirectory-filter SUB_FOLDER_NAME
– Create a new git repos and fetch filtered repos to the new git repos
Git
Written on
September
7th,
2025
by
Borting