How to change git repository using android studio

家住魔仙堡 提交于 2020-04-06 04:21:52

问题


I'm using git with android studio and I already sync other repository.

But I hope to change a git repository like github.

I think I need to disconnect already connected to the repository but I don't found this option.

To do that, How can I do?


回答1:


Go to your project directory and delete hidding .git folder like shown below

you will be disconnected to git.




回答2:


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

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

  1. Now you got the “Git Remotes” popup

  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.

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

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

Happy Coding :)




回答3:


You can use SmartGit application and set your new git url at "Remote\Properties..." and then push button "Store".

Or you can go to "[project folder]\.git" and edit "config" file. Find line "url = https//[your current url]" and put your new url instead.



来源:https://stackoverflow.com/questions/30586252/how-to-change-git-repository-using-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!