Farhana Naaz Ansari
Farhana Naaz Ansari

Reputation: 7944

Adding Android Studio Project to new git Repository

I create a new repository in bitbucket and create new android project want to add in a new repository but whenever I do the old android bitbucket project added to new repository along with the new Android project, I want only one project with one repository, I tried all nothing is working, I have also changed URL from git bash but whenever I add, commit and push project from android studio, it shows old project hierarchy in push window and it pushes to new repository. I don't want to add an old project with a new repository. I tried many command rehead,rebash etc etc..any help will be appreciated

Upvotes: 0

Views: 2620

Answers (3)

Josh Cronkhite
Josh Cronkhite

Reputation: 95

This may help with Bitbucket. If you create a new repository that includes any templates, it may be problematic in Android Studio if you're less familiar with git. Be sure to select "No" for option "Include a README?". Here's what it looks like at the time of this post:

enter image description here

Upvotes: 0

Code-Apprentice
Code-Apprentice

Reputation: 83517

From the comments:

Parent directory has common git directory

That's the problem. You need to create your new project in a directory that does not already have a .git directory. This .git directory stores all of the information for a repository. Each repo must have an independent .git directory. So create a new Android Studio project in a different folder. Then cd to that directory and run git init from the command line.

Upvotes: 1

Abdulmalek Dery
Abdulmalek Dery

Reputation: 1016

I have encountered a similar problem and found that the best solution is as follows:

1-Create the repo on the bitbucket.

2-Upload your android project to bitbucket using git extensions (very nice program to dealing with any git host).

3-Now open the project using android studio and it will be automatically set with the VCS and now you could easily push and pull and do any git stuff from inside android studio

Upvotes: 0

Related Questions