如何将 Eclipse 项目从 git 导入到 Android Studio?

如何将 Eclipse 项目从 git 导入到 Android Studio?

问题描述:

我在 Eclipse 项目中有一个 android 应用程序代码存储在 git 服务器中,我想将它导入到 Android Studio 中.

I have an android app codes in eclipse project stored in git server, and I want to import it into Android Studio.

有没有办法将项目从 git 中直接检索到 Android Studio 中?是否有实现此目的的分步说明?

Is there a way to retrieve the project from git directly into Android Studio? Is there a step-by-step instruction to achieve this?

这里是一步一步的解决方案.您可以使用您的 eclipse 代码目录.

Here is the step by step solution to do it. You can use your eclipse code directory for it.

  1. 打开Android Studio -> 导入项目-> 选择你的项目目录.(在上述情况下MyApp")记住选择包含清单文件的目录,否则新的直接导入向导"不会被触发并且 android studio 使用旧的导入向导.
  2. Android Studio 将使用新的目录结构创建项目MyApp_imported"的副本.
  3. 将现有的.git"目录复制到MyApp_imported"中
  4. Android Studio -> VCS -> 启用版本控制这将使 Android Studio 使用您现有的存储库来导入项目.虽然导入的项目有不同的目录结构,但 git 处理得很好.
  5. Android Studio -> 变化查看所有文件并提交.Git 会自动处理新的目录结构,文件历史记录等不会丢失.
  6. 现在你可以通过以下方式在 github/Bitbucket 上分享VCS-> 在 GitHUb 上分享注意:- 对于 bitbucket,您必须为 Android Studio 安装以下 Bitbucket 插件".http://plugins.jetbrains.com/plugin/6207?pr=androidstudio

这里有更多细节:将带有版本控制系统的eclipse android项目导入Android Studio