Create new repo from a folder
git clone <base repo>
cd <base repo>
git filter-repo --path folder/
git remote set-url origin <new repo>
git push -u origin main
Add repo as a folder
git subtree add -P <folder> <repo> <branch>
Delete history for a path
git filter-repo --path <delete> --path <delete> --invert-paths
Keep history only for a path
git filter-repo --path <keep> --path <keep>