what worked for me is ,
- remove
.gitfolder - copy
.gitfrom other repo - now
git checkout
Before Removing , You can try
git fetch --all
git reset --hard origin/master
You will need to replace master with the appropriate branch, which now defaults to main.