Change remote Git URL after forking a repository

Public, Git

harrylevine

Created: Oct 13, 2015     Updated: Oct 13, 2015


After you have forked and cloned the repository:

$ cd into-the-repository
$ git remote set-url origin https://github.com/username/repo-name.git

So for example, if your GitHub username is hpjaj, and the repo is holo-alfa, here is the command:

$ cd holo-alfa
$ git remote set-url origin https://github.com/hpjaj/holo-alfa.git

To confirm that it worked, run git remote -v. You should see something like:

origin  https://github.com/hpjaj/holo-alfa.git (fetch)
origin  https://github.com/hpjaj/holo-alfa.git (push)