by Sai gowtham

How to change a remote URL in Git

In this tutorial, we are going to learn about how to change a cloned repo remote url in git.

Changing a Git remote URL

  1. Change your current working directory to the cloned git repo folder.
cd my-git-repo
  1. To change a remote URL we need to run the git remote command followed by the set-url, origin and your new remote url.
git remote set-url origin https://github.com/saigowthamr/javascript.git

Note: In the above code, you need to add your own remote url after origin.

  1. Now we need to verify our remote url is changed successfully or not by running git remote command followed -v flag.
git remote -v

The output will look like this:

origin https://github.com/saigowthamr/javascript.git (fetch)
origin https://github.com/saigowthamr/javascript.com.git (push)

Top Udemy Courses

JavaScript - The Complete Guide 2020 (Beginner + Advanced)
JavaScript - The Complete Guide 2020 (Beginner + Advanced)
45,614 students enrolled
52 hours of video content
View Course
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
284,472 students enrolled
40 hours of video content
View Course
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
130,921 students enrolled
21 hours of video content
View Course