About this question
Need to update your Git remote URL after switching platforms or accounts? Learn how to quickly change the remote repository URI so you can push and pull code from the right location without any hiccups.
Need to update your Git remote URL after switching platforms or accounts? Learn how to quickly change the remote repository URI so you can push and pull code from the right location without any hiccups.
Log in to share your answer and help other learners.
Log in to answerBest Answer · By JanBask DevOps Expert
Answered on Apr 16, 2025
Changing the URI (or URL) for a remote Git repository is a pretty common task—especially if you’ve moved your repo to a different Git hosting service (like from GitHub to GitLab) or switched from HTTPS to SSH. Luckily, it’s super easy to update.
Here’s how you can do it:
git remote -v git remote set-url origin Replace with your new repository link, whether it's an SSH or HTTPS URL.
Verify the change
After updating, check it again:
git remote -vThis should now show your updated URL.
Example:
Let’s say you’re switching from HTTPS to SSH:
git remote set-url origin git@github.com:yourusername/your-repo.git Why this matters:
Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.
Most-read guides across JanBask
Common DevOps interview questions, answered
Guides, tips and career advice on DevOps from JanBask experts.
DevOps How to Become a DevOps Engineers: Learning Path, Critical skills & More
Looking for answer to how to become a DevOps engineer in 2025? Here is the detailed article about DevOps career path, DevOps…
DevOps Top 50+ Jenkins Interview Questions And Answers For 2025
Here are the Top 50 Jenkins interview questions frequently asked in top MNCs which will help you land an ideal job! These…
DevOps Best 37 DevOps Tools To Learn And Master In 2025: Docker, Git & More
Want to know what are Devops tools and their uses? Or looking for the best DevOps list for automation, monitoring, & development?…
DevOps DevOps Engineer Job Description: Roles and Responsibilities [2025 Updated]
Discover the essential roles and responsibilities of a DevOps Engineer by exploring the detailed DevOps job description, and…