Connecting Android Studio Project with BitBucket

Android Studio can out-of-the-box work with GitHub but not with BitBucket. There are a lot of tutorials on the Internet which describe a way to work with a BitBucket Repository and an Android Studio Project mostly by using the inbuilt Terminal Window from Android Studio.

This Tutorial is not about using the Terminal Window. All the Push, Pull, Commits, etc. are done from the VCS menus inside the Android Studio IDE.

First, you need to download the BitBucket Plugin:

https://bitbucket.org/dmitry_cherkas/jetbrains-bitbucket-connector/downloads

Don’t unzip the file.

In the next step, we are going to install the Plugin. If Android Studio is already open with one of your projects, go to the settings button in the toolbar and choose Plugins.

The same menu can also be reached from the Welcome screen:

Configure -> Plugins

Screenshot from 2015-05-09 14:54:49

Choose the option <Install plugin from disk ..>

and navigate to the downloaded Plugin. Choose the .zip file and click <OK>.

Screenshot from 2015-05-09 14:57:28

Restart Android Studio and the Plugin is ready to use.

Start a new Android Studio Project or use the one you have already open.

The Project needs to be activated for using VCS.

Screenshot from 2015-05-09 15:13:09

Like GitHub, BitBucket is based on Git.

Screenshot from 2015-05-09 15:13:43

This is similar to the connection with a GitHub Repository.

Screenshot from 2015-05-09 15:14:42

But the Share did not work in my tests. It’s worth to try it. Maybe it works with another OS or an updated version.

I did this with Ubuntu 14.04.

Screenshot from 2015-05-09 15:17:28

What I did instead was:

Creating a Repository on the Web at BitBucket, with exact the same Project Name.

Screenshot from 2015-05-09 15:41:14

Take notice of the line:

git remote add origin ….

you will need only the HTTP address from this line.

Screenshot from 2015-05-09 15:44:52

Fill in the HTTP address from BitBucket

Screenshot from 2015-05-09 15:45:28

After that, I was able to commit and push the “Changes”. The Online Repository did not have any files after creating. So, the commit and push, brings up all the files I have in Android Studio.

Screenshot from 2015-05-09 15:45:57

 

 

The control Online at BitBucket shows the new Repository.

Screenshot from 2015-05-09 15:48:35

To import an Android Studio from BitBucket worked in my tests too.

To do this, pick from the Welcome screen “Check out project from Version Control” and choose BitBucket.

Screenshot from 2015-05-09 15:57:47

 

Use the Pulldown menu to choose the project you want to import.

Screenshot from 2015-05-09 15:58:33

 

 

Click through the import process and wait that the project opens. That’s it.

 

 

Category: BitBucket, Git, Plugin, VCS
Tags: