Here is the step by step solution to do it.
You can use your eclipse code directory for it.
- 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.
- Android Studio will create a copy of your project "MyApp_imported" with new directory structure.
- Copy your existing ".git" directory inside "MyApp_imported"
- 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.
- Android Studio -> Changes
Review all files and commit. Git will automatically handle new directory structure and file history etc will not be lost.
- Now you can share it on github/Bitbucket by
VCS-> Share it on GitHUb
Note:- For bitbucket you will have to install "following Bitbucket plugin" for Android Studio.
http://plugins.jetbrains.com/plugin/6207?pr=androidstudio
Here are more details about it: Import an eclipse android project with version control system into Android Studio