Uploading an Android Studio project into BitBucket is not as easy as it looks like. Download the BitBucket plugin for Android Studio before proceeding.
Once you finish creating a repository in the BitBucket website, go to your Android Studio project and delete all build folders. You do not want those excess folders and its files to be uploaded as well.
Once done, proceed to the following steps:
- Go to VCS > Import into Version Control > Create GIT Respository. Ensure your working folder is the root.
- Right click your Android Studio project > GIT > Add
- Go to Terminal TAB at the bottom of the Android Studio IDE and type the following commands:
- The BitBucket website has a section that says “I have an existing project” and tells you to run the 3 commands. You actually just need one that says remote add.
- Then type “git init .” , press ENTER
- Then type “git checkout -b master” , press ENTER
- Then type “git commit -am “first commit” , press ENTER
- Then type “git push -u origin –all” , press ENTER and input your BitBucket password
That’s it! You can then check your BitBucket account to verify that your project files had been successfully uploaded.