Adding Android Studio Project to new git Repository
Adding Android Studio Project to new git Repository
I create a new repository from 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 also show old project hierarchy in push window and it pushes to new repository. I don't want to add old project with new repository. I tried many command rehead,rebash etc etc..any help will be appreciated
.git
they are the same directory structure. yes, Parent directory has common git directory.
– farhana
Jun 30 at 5:08
See my updated answer
– Code-Apprentice
Jun 30 at 5:38
2 Answers
2
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.
.git
.git
.git
cd
git init
It means I have to create
.get
with the single project not common for all?– farhana
Jun 30 at 5:41
.get
@farhana Yes, if you want each project in a separate Git repository, you must create a new Git repository for each project.
– Code-Apprentice
Jun 30 at 5:49
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).
git extensions
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
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
What is the directory structure of your two projects? I mean, are both projects in the same directory? Does that parent directory have a
.git
directory? (Be sure to "show hidden files" in order to check.)– Code-Apprentice
Jun 29 at 18:11