Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure Android Studio with Bitbucket team repo

I am trying to configure Android Studio to work with my team repo on Bitbucket. What I would like to do in the first place is to push my local project onto my team's repo.

I have already installed the Bitbucket plugin but don't really know where to go from here. When I try to commit the changes, all I get is "No changes detected".

like image 565
halpsb Avatar asked Feb 24 '14 14:02

halpsb


People also ask

What is Bitbucket in Android?

We've launched a new Android template in Bitbucket Pipelines. This template helps you automate building and testing an Android project in a Docker container, using Gradle as your build tool. Access the template code here or go to the Pipelines tab of your repo and select the Android template.


2 Answers

Without Using Any Plug-in


  1. First from VCS menu of android studio select Enable Version Control Integration, it will ask you for selecting versioning tool, select git from the drop down.
  2. Create new repository in the BitBucket account for the project, selecting git as the repository type.
  3. Now from the terminal window at the bottom of android studio, type: git add -A This will add the files to git for committing.
  4. To commit with a message type git commit -m "First Commit" in the terminal. Here, First Commit is just a message i used for demonstration.
  5. From Bitbucket, in the newly created repo, select I have an Existing Project from below. It will give you two command line commands. Use Them consecutively. These will add the local repo to the bitbucket. First one: git remote add origin https://[email protected]/example/test.git Second one: git push -u origin master
  6. Add again git add -A
  7. Then Commit git commit -m "Second Commit"
  8. Push for the last time git push origin master

  9. You can check that the branch is up-to-date by writting git status

    On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working tree clean

  10. Done . My Android Studio version was 2.3.3 & git version 2.13.0.windows.1
like image 68
Rakibul Haq Avatar answered Oct 15 '22 10:10

Rakibul Haq


So I am assuming you have a local project and you need to import it into your Repository in BitBucket. Since you already have the BitBucket plugin installed, follow the below steps:

  1. Goto VCS Menu > Import into version control > Share Project
  2. You will have to give your credentials when prompted.
  3. On the next dialogue, give a name and a description to your project and then click OK

Now you have got your project imported to BitBucket. Now to checkout a project from BitBucket:

  1. VCS > Checkout from version control > BitBucket
  2. Select the project you want to checkout

After you have added the project to BitBucket, you will see a menu called Git in you VCS menu, which has all the options of Git.

Now depending on the version of android studio and the BitBucket plugin you are using, you are likely to get some errors while doing these. I did these using Android Studio 0.8.2 and Bitbucket plugin version 1.2.2.

Also make sure in the Android Studio Preferences > Version control, the directory is set to <Project> and the VCS to Git. Unless you are using Mercurial or anything it is advisable to remove any VCS other than Git from there. If all these are right everything should be working well.

like image 26
Harikrishnan Avatar answered Oct 15 '22 09:10

Harikrishnan