How to change git repository using android studio

We can change the repository url. Just follow the steps.

In Android Studio Arctic Fox | 2020.3.1

  1. Right click on project folder
  2. From menu Choose “Git”
  3. Then chosse “Manage Remotes…”
  4. Now, select the existing “origin” and click on edit
  5. Enter your new URL and click OK

For Android Studio Older versions

  1. Right click on project folder
  2. From menu Choose “Git
  3. Choose “Repository
  4. Choose “Remotes…”

Git > Repository > Remotes...

  1. Now you got the “Git Remotes” popup

Git Remotes

  1. You can edit the existing url or remove the old url and then add new url.
  2. Click “OK”. that’s it. Now you are connected with new repo. But branches are not connected. Just follow few steps to complete.
  3. Try to pull the changes from repo “Git > Repository > Pull…
  4. Now you got the “Pull Changes” popup. Click “Refresh” button.

Pull Changes

  1. After successfully reconnected with repo then you can see the branches of new repo under “Branches to merge” box.

Branches to merge

  1. Done. Now you are connected with new repo & branches.

Happy Coding 🙂

Leave a Comment