Import an eclipse android project with version control system into Android Studio

Here is the step by step solution to do it.

  1. Open Android Studio -> Import Project-> Select your project directory. (In above case “MyApp”)
    Remember Select the directory which contains Manifest file otherwise new “direct import wizard” doesn’t
    get triggered and android studio uses old import wizard.
  2. Android Studio will create a copy of your project “MyApp_imported” with new directory structure.
  3. Copy your existing “.git” directory inside “MyApp_imported”
  4. Android Studio -> VCS -> Enable version control
    This will make Android Studio use your existing repository for imported project. Though imported project has
    different directory structure but git handles them pretty well.
    You might want to also call git add . and git add -u in the root folder of the imported project to make sure all new files are added and existing file moves are detected by git.
  5. Android Studio -> Changes
    Review all files and commit. Git will automatically handle new directory structure and file history etc will not be lost.
  6. Now you can share it on github/Bitbucket by
    VCS-> Share it on GitHUb
    Note:- For bitbucket you will have to install “Bitbucket plugin” for Android Studio.

Leave a Comment