简体   繁体   English

如何在Android Studio中将git repo从Bitbucket转移到Github?

[英]How to transfer git repo from Bitbucket to Github in Android Studio?

So I have an Android Studio project that I have on Bitbucket that I'm having trouble moving to Github. 因此,我在Bitbucket上有一个Android Studio项目,但无法迁移到Github。 So far I've imported the project to Github using its import feature and changed the origin using "git remote set-url". 到目前为止,我已经使用导入功能将项目导入到Github,并使用“ git remote set-url”更改了来源。 Now every time I try to push & commit using Android Studio I get the error "fatal: Could not read from repository". 现在,每次我尝试使用Android Studio推送并提交时,都会出现错误“严重:无法从存储库读取”。 Also I don't know if it has anything to do with the problem but I have tried to change the SSH executable from built-in to native. 另外,我不知道是否与问题有关,但我尝试将SSH可执行文件从内置更改为本地。

Edit: To clarify, the problem I'm having is committing and pushing using Android Studio. 编辑:澄清一下,我遇到的问题是使用Android Studio提交和推送。 Everything works fine if I use git commands but when I use the Android Studio interface the "fatal: Could not read from repository" error pops up. 如果我使用git命令,一切正常,但是当我使用Android Studio界面时,弹出“致命:无法从存储库读取”错误。

I suggest creating separate remotes rather than changing the URL for origin . 我建议创建单独的遥控器,而不要更改origin URL。 For example, you can do 例如,您可以

git remote add bitbucket <URL for BitBucket repo>
git remote add github <URL for GitHub Repo>

Now you can pull and push from each remote as you wish. 现在,您可以根据需要从每个遥控器中拉动和推动。 For example 例如

git checkout master
git pull bitbucket master
git push github master

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从 github 存储库中的子目录创建 Android Studio 项目 - How to create an Android Studio project from a subdirectory in a github repo 如何在 android 工作室中实现另一个 github 帐户的分叉回购? - How to implement a forked repo from another github account in android studio? 删除 github 中的 repo 后,Android Studio 警告“...Repository not found.”,如何指定从 Android Studio 中的另一个 repo 获取 - After deleting repo in github, Android Studio warns “…Repository not found.”, how do I specify fetch from another repo in Android Studio Android Studio-Gradle-GitHub存储库 - Android studio - Gradle - GitHub Repo 从 ssh Git (bitbucket) 链接创建 android studio 项目 - Create android studio project from ssh Git (bitbucket) link Android Studio-如何从仅包含自述文件和许可的Github存储库中“创建” Android项目 - Android Studio - How to “create” an Android project from a Github repo that only contains Readme & License 为什么Android Studio忽略git repo中的文件以及如何从git导入项目? - Why Android Studio is ignoring files in git repo and how to import a project from git? 如何从bitbucket下载项目到android studio - How to download a project from bitbucket to android studio 如何在github的同一仓库中添加android studio项目 - How to add android studio project in same repo on github Android Studio重命名包-Bitbucket和Git管理 - Android Studio Rename Package - Bitbucket and Git Management
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM