I created a repo on Github and cloned it on my local PC using the SSH path which was like:-
git@github.com:user-name/orig_repo.git
That is exactly the URL path that can be seen in the config file of the .git folder in my cloned directory. Then I renamed the Remote Repo, which changed the SSH URL based on the new name:-
git@github.com:user-name/new_repo.git
Since git doesn't care about the name of the local directory as long as the path to which you push is defined properly, I renamed my local directory to the same name of the new repo as new_repo, which is just for sake of my convenience and not a necessity.
What is of more importance is that the path to which it should push has changed ideally, but I still see the original SSH path in my config file, which is:-
git@github.com:user-name/orig_repo.git
But despite the older path, I can push all changes and it reflects in the remote repo properly. I am not sure how this mismatch between the SSH paths is handled. Does git redirect the changes automatically to the new path?
I am using VS Code for running the Git commands, in case it has any effect.