Add your Android Studio project to BitBucket

So, I had this Android Studio project in svn, and I wanted to migrate it to Bitbucket. I’m using Ubuntu 13.10 and Android Studio 0.5.4.

Bitbucket currently has this awesome free plan for private projects up to 5 users, which is a great deal for starting up.

So, first things first:

0: register to Bitbucket
1: create the empty project repo in BitBucket, give it the name of your Android project
2: in your terminal, move to the root directory of the project you want to move to git.
2a: in my case, I deleted all svn directories and files, because I don’t want git to index also those files
3: $ git init
4: $ git add .
5: $ git commit -m "initial commit"

These steps created the local git repository. Now let’s load all into the remote Bitbucket repository:

6: git remote add origin https://<username>@bitbucket.org/<username>/<projectname>.git
7: git push -u origin
8: git push -u tags

Now the project have been uploaded.

Open your local project in Android Studio, go File -> Settings… -> Version Control, specify “git” as Project version control.

If you come from svn, remember to click “Commit and push”, not only “Commit” to upload your changes.

Questa voce è stata pubblicata in Android Studio e contrassegnata con , , , . Contrassegna il permalink.

Lascia un commento