I faced the same problem when I renamed my repository on GitHub. I tried to push at which point I got the error
fatal: 'origin' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
I had to change the URL using
git remote set-url origin ssh://[email protected]/username/newRepoName.git
After this all commands started working fine. You can check the change by using
git remote -v
In my case after successfull change it showed correct renamed repo in URL
[aniket@alok Android]$ git remote -v
origin ssh://[email protected]/aniket91/TicTacToe.git (fetch)
origin ssh://[email protected]/aniket91/TicTacToe.git (push)