using https://github.com/newren/git-filter-repo
mkdir import_tmp; cd import_tmp
wget https://raw.githubusercontent.com/newren/git-filter-repo/main/git-filter-repo # get the code
git clone https://github.com/fortio/fortio # the source repo
cd fortio/
python3 ../git-filter-repo --path fhttp --path fgrpc --path-rename 'fhttp:legacy/fhttp' --path-rename 'fgrpc:legacy/fgrpc'
ls legacy # works!
# on the target:
cd ../destination_history_import/
git remote add import_remote ../fortio # the source
git switch -c import # where to push
git fetch import_remote
git merge import_remote/master --allow-unrelated-histories
# git push