• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
The Electric Toolbox Blog

The Electric Toolbox Blog

Linux, Apache, Nginx, MySQL, Javascript and PHP articles

  • Applications
  • FCKEditor
  • Apache
  • Windows
  • Contact Us
Home / How to change the remote url for your local git repository

How to change the remote url for your local git repository

If you’ve moved a git repository from one git hosting service to another, transferred from one account to another at the same service (here’s how to transfer between accounts at Bitbucket) or moved your own repository servers around the place, you’ll need to change the remote url for you local repository to be able to continue pushing and pulling changes, etc.

Check the existing remotes

Use this command to check what you have configured as the current remote:

git remote -v

If the git repository is at e.g. Bitbucket, the login name MyUsername and the repository coolproject, then running the above command would output something like this:

origin	git@bitbucket.MyUsername/coolproject.git (fetch)
origin	git@bitbucket.org:MyUsername/coolproject.git (push)

Change the remote url

To change your local repository’s origin to e.g. another accout within Bitbucket (YourUsername), use the set-url command like so:

git remote set-url origin git@bitbucket.org:YourUsername/coolproject.git

Done! You might want to run "git remote -v" again to check it’s all looking good.

Check Out These Related posts:

  1. Git Rename Branch
  2. Scp command
  3. Inadvertent upgrade from openSUSE 10.2 to openSUSE 10.3
  4. Change the commit message with git

Filed Under: Applications

Primary Sidebar

Categories

  • Apache
  • Applications
  • Article
  • Case Studies
  • Email Servers
  • FCKEditor
  • HTML And CSS
  • Javascript
  • Linux/Unix/BSD
  • Microsoft SQL Server
  • Miscellaneous Postings
  • MySql
  • Networking
  • Nginx Web Server
  • Offsite Articles
  • OSX
  • PHP
  • Quick Tips
  • RFC – Request for Comments
  • SilverStripe
  • VMWare
  • VPN
  • Windows
  • WordPress

Recent Posts

  • Vim Show Line Numbers
  • Add User To Group Linux
  • Chmod 777 Tutorial
  • How to Copy Directory Linux
  • Linux create user

Copyright © 2021. ElectricToolBox. All Rights Reserved.

  • Contact Us
  • Copyright Info
  • Privacy Policy
  • Sitemap