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.
There is a bug in the third-party Bitbucket plug-in which is preventing it from working, although you can still configure Android Studio to work with Version Control.
VCS > Checkout from Version Control > Mercurial
or Version Control > Git
.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:
Now you have got your project imported to BitBucket. Now to checkout a project from BitBucket:
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.
Without Using Any Plug-in
git add -A
This will add the files to git for committing.git commit -m "First Commit"
in the terminal. Here, First Commit is just a message i used for demonstration.git remote add origin https://example@bitbucket.org/example/test.git
Second one:
git push -u origin master
git add -A
git commit -m "Second Commit"
Push for the last time git push origin master
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
2.3.3
& git version 2.13.0.windows.1
You need to add the files to your local repository first. Go to menu VCS -> Show Changes View. Add all the files. Then got to menu VCS -> Import into Version Control -> Share project.
You will be ask to enter the bitbucket origin URL. And that's it.
Here is what you can try.
Note:- For bitbucket you will have to install "following Bitbucket plugin" for Android Studio. http://plugins.jetbrains.com/plugin/6207?pr=androidstudio
//Easy tutorial on android studio with bitbucket (linux)
Note: here "testp" , "gtest" and "MyApplication" are only example
Now project is created 6.right click on the project and clik new> add module > import project(this is where you import the already existed android project) 7.After every thing is done, build.gradle may have build problem ,if occur paste following code :
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
}
}
allprojects {
repositories {
jcenter()
}
}
now cd up to your bitbucket clone folder using android terminal
// clone on other computer
clone the bitbucket project using vcs option and load project(not import) after it get clone
if this not work:
vcs clone to desired directory((click no ,if it ask something like yo have check out an android studio project..Would you like to open it)) and import the project using exact same location of clone directory(use gradle wrapper if asked : it may download so wait) and lastly enable vcs for push and commit.