Suppose your company decides to change its code-hosting provider or you wish to move your own Git repository to a different host. It doesn’t happen often, but it happens. When I had to move a number of Git projects to a new host, it took me quite some time to find an accurate method.
Having made many attempts, and a couple of fails, and carefully reading Git’s documentation, I found a solid and effective way. I thought, then, that every developer would benefit from knowing how to migrate a Git repository to a new host quickly and easily. The most important thing is to make sure that your branches and tags and your commit history are all moved.