Problem moving from a repo to another with history + rename

Hello,
I’ve spent my last days trying to have things to work, but I’m not able to have everything merged with history. I’ve googled and tried almost everything on SO suggestion.

The scenario is the following.

  • Have some repositories that had been migrated from VSS and are in the form Name/Project/Name
  • I wish to move all of them under folders on a repo called MyApplication/

To complicate things , two project must be put in a folder called bin instead of project name.

Here’s the code I use

echo off
set arg1=%1
set arg2=%2

git clone --branch master --origin origin --progress -v https://<URL>%arg1%.git %arg1%

cd %arg1%

git filter-repo --force --subdirectory-filter Project

git mv %arg1% %arg2%

git commit -m "test'

The second scripts performs the merge

set arg1=%1
set arg2=%2

cd %arg2%
git remote add old-project ../%arg1%
git fetch old-project
git checkout 
git merge  --allow-unrelated-histories old-project/master
git push origin master
git remote rm old-project

Now. The issue came when I perform on the first file the git mv ....

Since if I don’t do the mv and the commit, when I execute the second file, I’ve got in my new repo the folder (named with old name) with history.

Consier I’ve got a folder that’s called Bin7 that should be moved to bin . I this case the folder on my destination repo is Bin7.

If I do the git mv and the commit, then I execute the second batch file, I got the correct directory naming (bin) but I got for each file the “test” commit and nothing else.

What am doing wrong?

Thanks

Paolo