git 如何使用android studio更改git存储库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30586252/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to change git repository using android studio
提问by JayD
I'm using git with android studio and I already sync other repository.
我正在将 git 与 android studio 一起使用,并且我已经同步了其他存储库。
But I hope to change a git repository like github.
但是我希望能换一个像github这样的git仓库。
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?
要做到这一点,我该怎么办?
采纳答案by Noor Nawaz
Go to your project directory and delete hidding .git folder like shown below
转到您的项目目录并删除隐藏的 .git 文件夹,如下所示
you will be disconnected to git.
您将与 git 断开连接。
回答by Divakar Murugesh
We can change the repository url. Just follow the steps.
我们可以更改存储库 url。只需按照步骤操作即可。
- Right click on project folder
- From menu Choose “Git”
- Choose “Repository”
- Choose “Remotes…”
- 右键单击项目文件夹
- 从菜单中选择“ Git”
- 选择“存储库”
- 选择“遥控器...”
- Now you got the “Git Remotes” popup
- 现在你得到了“ Git Remotes”弹出窗口
- You can edit the existing url or remove the old url and then add new url.
- Click “OK”. that's it. Now you are connected with new repo. But branches are not connected. Just follow few steps to complete.
- Try to pull the changes from repo “Git > Repository > Pull…”
- Now you got the “Pull Changes” popup. Click “Refresh” button.
- 您可以编辑现有网址或删除旧网址,然后添加新网址。
- 单击“确定”。就是这样。现在您已连接到新的 repo。但是分支没有连接。只需按照几个步骤即可完成。
- 尝试从 repo “ Git > Repository > Pull ...”中拉取更改
- 现在你得到了“Pull Changes”弹出窗口。单击“刷新”按钮。
- After successfully reconnected with repo then you can see the branches of new repo under “Branches to merge” box.
- 成功重新连接 repo 后,您可以在“要合并的分支”框下看到新 repo 的分支。
- Done. Now you are connected with new repo & branches.
- 完毕。现在您已连接到新的 repo 和分支。
Happy Coding :)
快乐编码:)
回答by Evgeny Sinitsky
You can use SmartGitapplication and set your new git url at "Remote\Properties..." and then push button "Store".
您可以使用SmartGit应用程序并在“ Remote\Properties...”中设置新的 git url,然后按下按钮“ 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.
或者您可以转到“ [项目文件夹]\.git”并编辑“ config”文件。找到行“ url = https//[your current url]”并输入新的 url。