Thursday, 11 January 2018

Bitbucket Integration With Android Studio

  No comments
These steps only works if you have existing android studio project
In Android Studio
Step 1 : Navigate to VCS => Enable Version Control Integration => Git
Step 3 : Choose "Terminal" option in android studio and get a repository link from bit bucket account.
Step 4: git remote add origin https://gangsofcoder@bitbucket.org/Gangsofcoder/demoproject.git , copy link something look like this in bit bucket account and paste it inside the android studio project.
 Step 5 : git add . (paste this line)
Step 6: error: src refspec master does not match any( get if you not do step 5) 
Step 7: git commit -m "initial commit" 
Step 8 : git push -u origin master
Maybe you just need to commit. I ran into this when I did:
mkdir repo && cd repo
git remote add origin /path/to/origin.git
git add .
Oops! Never committed!
git push -u origin master
error: src refspec master does not match any.
All I had to do was:
git commit -m "initial commit"
git push origin master
Success!
If you are not in android studio and want to push from the folder. In this case you need to run following command straight.
1. Navigate to the folder through cmd
2. Run command "git  init" -: it will initialized empty git repository  i.e .git  
3. Add a new repository in bitbucket and after that you will get something like this with your created repository name "git remote add origin https://YourId@bitbucket.org/YourUsername/YourProjectName.git" , Run this in command prompt
4. git add .
5. git commit -m "initial commit" 
6. git push -u origin master
All Done  

No comments :

Post a Comment

Loading...