How to change URL or Path of remote Git repository

Sometime when we work in git, there are more possibility to change the URL or path of remote git repository, right ?

So in this article, we will learn how to make these changes with a simple git stated command line interpreter.

Try this ,

$ git remote -v        # View existing remote repository
# origin (fetch)
# origin (push)

Now replace with the new URL

$ git remote set-url origin
# Change the 'origin' remote's URL

Validate the new URL or Path

$ git remote -v
# Verify new remote URL
# origin (fetch)
# origin (push)

About Shachindra Yadav

I, Shachindra Yadav, a Cloud Certified, DevOps and technology enthusiastic person, more passionate to learn and write blogs in my free time.

View all posts by Shachindra Yadav →