How to import a Project into bitbucket repository from Android Studio?
- In the Android studio, go to VCS-> 'Enable version control'.
From dropdown menu select Git, then click OK.
- Right click on your Project view in the Android Studio:
go to Git -> Add.
(All the files in the project should change the color, turned green probably)
- Open Terminal in the Android studio.
From your empty repo in the Bitbucket page, copy from the paragraph "Step 2: Connect your existing repository to Bitbucket" the line :
git remote add origin https://<user>@bitbucket.org/<path>.git
, then Enter.
Now type:
git commit -m "initial commit"
(to commit all the files from the Project), then Enter.
Now type:
git push -u origin master
(to push all the commited files to the master
- or the other branch, just change "master" to other branch).
That's it. Your project is versioned and placed in your Bitbucket repo.
Here is how I did it without plugins:
Create the repository on your Bitbucket account
Create your project in Android Studio
In Android Studio, Go to VCS
Choose 'Enable version control'
Choose Git and press OK
Right click on your project, choose Git then click Add
Open Terminal in Android Studio
Go to your Bitbucket repository Overview
Click on 'I have an existing Project'
Copy the 'git remote add origin ... etc.' line to your terminal and press enter
Click on 'Commit Changes', write your comment then press Commit and push
Also add the 'git push -u origin master' in the terminal at part 10 of above