I accidentally created a remote branch named regacy (instead of legacy) and my local master branch is currently tracking origin/regacy.
I want to correct this using the git rename remote branch approach, essentially renaming origin/regacy to origin/legacy or origin/master.
I tried running:
git remote rename regacy legacy
But it threw this error:
error: Could not rename config section 'remote.regacy' to 'remote.legacy'
What’s the correct way to rename a remote branch in Git without breaking the local tracking setup?
Any advice on how to safely do this and push the changes would be appreciated!