what worked for me is ,
- remove
.git
folder - copy
.git
from 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
.