Here's my situation: (This is typical of how I personally like to work with code)
I create a directory on my filesystem somewhere, cd
into it, and start creating and editing some code files.
If the project starts taking a productive trajectory, I will at some point decide that it is useful to initialize some version control and to have a backup. So I will create a git repository, add all files to it, set the "origin / master" thing and then do a push.
So now I have a GIT repo on a server somewhere which I created from a directory on my system.
Then, some time later, I will have some idea for something I want to try. I could use branches for this, but this is usually inconvenient. Instead I will copy the entire directory, and then edit code in the new directory.
So now I have another directory. It contains a copy of the git repo, so "it thinks" it is the same as the original directory. Git doesn't know I've copied the directory somewhere else.
What I want to do is to keep the history of this repository, but create a new "origin master" on another server somewhere, and change the name of the repository to match the name of the directory which contains it. (Directory has a different name to the original directory it was copied from.)
I assume this must be fairly trivial to do, but I've never seen any description of how to do it in any tutorials and searching for "copy directory change git repository" obviously doesn't return a lot of useful info.