Change URL Of Git Repository
read more

Change URL Of Git Repository

In this tutorial we are going to learn how you can change the URL of your GIT repository to move the code onto a new server or host.

There are different approaches you can do for this task, you can either simply change the origin URL and commit everything to this new repository, then you will be starting from scratch on this new server. But you will lose all the previous branches and tags you had on project, if this isn’t a problem then changing origin URL is fine, mostly likely you will want all previous branches and this tutorial will help with this.

First I’ll start off by explaining how you can simply change the origin URL of the repository.

At the root of the project where GIT is setup you simply need to run the following command.