Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Commit and Push Android App/Project to Pre-existing Empty Bitbucket Repository with Android Studio?

So I'm running the latest version of Android Studio (0.6.1) and want to push to BitBucket because it has free private repos (let's avoid any Github vs BB comments). I've created a simple repo to test the VCS functionality and am using a new Android project with the default configs except the app is called 'TestApp' and the project file is located on my desktop.

I've performed the following steps:

  1. VCS>Import into Version Control>Create Git Repository
  2. Use default path: "C:\Users\User\Desktop\TestApp"
  3. VCS>Git>Checkout from Version control
  4. Give https://[email protected]/sanecito/testrepo.git as VCS path and "C:\Users\User\Desktop\" as parent directory, and testrepo as folder
  5. When given "Would you like to create an Android Studio project for the sources you have checked out to C:\Users\User\Desktop\testrepo", hit "Yes"
  6. Create project from existing sources
  7. Project name: testrepo Project location: C:/Users/User/Desktop/testrepo
  8. Open project in new window
  9. Add textfile with text "test" to testrepo in IDE, "Do you want to add the following file to Git? [...]">Yes
  10. Hit VCS with green arrow button in the menu (Commit Changes)
  11. Mouse over 'Commit' button, hit commit and push
  12. Hit 'Push' in next window

Push window vanishes and there's a brief pop-up window at the bottom that there's "Nothing to push" despite showing in the previous window that there were changes to the project There are several issues with my process, the first is that I would like to create a vanilla Android project and then push to the empty repo, but in my trying to link it it creates a new project (abet without the vanilla app). Even with that new project when I hit commit and push it isn't actually pushed to the repo.

I'm aware that there's this question: How to import a Project into bitbucket repository from Android Studio? However, none of the of the answers are useful to solving what should be a simple issue as they aren't descriptive (i.e. how am I even supposed to setup the plug-in). Could someone tell me how to do two things:

  1. Setup Git with an existing Android project and application open and push to a repo on BitBucket
  2. Setup Git config with a fresh Android Studio install such that a person can pull from a BitBucket repo Android app code to work on
like image 244
Kurt Wagner Avatar asked Jun 24 '14 00:06

Kurt Wagner


People also ask

How do I copy a project from Bitbucket to Android studio?

You can try below steps to clone a bitbucket repo: VCS -> Git -> clone -> paste bitbucket URL repo -> clone. It can clone successfully. Save this answer.


1 Answers

The solution in full can be found here: https://www.youtube.com/watch?v=IBEbJUEDWZQ

I typed up how to setup the plugin and how pull from a non-empty repo (feel free to use parent directory of your own choosing, I just felt this lead to a clean setup), the video has how to push to an empty repo

  1. Setting up BitBucket plugin

    1. Download BitBucket Plugin for IDEA/Android Studio
      1. At the time of writing (2014/06/25) the official plugin does not support IDEA13 which the current version of Android Studio (0.6.1) uses. However, there is an unofficial version that works (get the latest version)
    2. Open Android Studio
    3. On main menu click 'Configure' and then 'Plugins'
      1. Click 'Install plugin from disk', navigate to the plugin .zip file location, select it, and hit OK.
    4. Restart Android Studio when prompted
  2. Pull BitBucket repository onto local computer repository

    1. If Android Studio is not already running, start it
    2. From the 'Quick Start' menu, select 'Check out from Version Control'
    3. For 'Parent directory' click "..." on the right and navigate to C:\Users\ [username]\repos
      1. If 'repos' does not exist, create a new folder by clicking the 'New Folder' button (or hotkey Alt+Insert) and name the new folder 'repos'
    4. In the 'Checkout from' dropdown select 'BitBucket' and enter BitBucket credentials if prompted
    5. From the 'Repository list:' dropdown, you should see your desired repo. Select it, and click 'OK'
like image 86
Kurt Wagner Avatar answered Sep 20 '22 05:09

Kurt Wagner