If you think a specified folder in your existing repo should be park at other repo then this is a good example to show how to do that and also you never lost any commit history.
Let say I have a repoA with a \folderB which will move into a new repoB
cd \repoA git filter-branch –-subdirectory-filter folderB -- --all mkdir folderB mv * folderB git add . git commit cd .. git clone repoB.git cd \repoB git remote add repoA ..\repoA git pull repoA master git remote rm repoA git push
**caution: You need to create a new repo without any commit yet otherwise you’ll get below error.
fatal: refusing to merge unrelated histories