Saturday, November 19, 2016

How to add existing Android Studio project to Bitbucket?

Here are the steps to add existing Android Studio project to Bitbucket git provider.

1.) Create a new repository in Bitbucket.
2.) Open the terminal window in Android Studio.
3.) Execute the following commands
   

  • git init
  • git add .
  • git commit -m "Initial Version"
  • git remote add origin https://techsabha@bitbucket.org/techsabha/mobileoffers.git
  • git push -u origin master
These steps will create a new git repository in local path and the push it to the remote bitbucket repository.

Addition Information:

Steps to create git branch and merge to master branch.

1.) git clone "git url"
2.) git branch "branch name"
3.) git checkout "branch name"
4.) Now you work on the branch and do the commits.
4.) Once the work is done then follow the steps to merge to master branch
5.) git checkout master
6.) git merge "branch name"
7.) git push