What is mandatory to versionate on Android git project? - android

I want to versionate an Android project with git but I am wondering what is mandatory to add to git repository.
I know about .gitignore file and I also have read this question: What should be in my .gitignore for an Android Studio project? but I have seen that there are a lot of different opinions about what should I add or remove from .gitignore file.
My question is not so open, I just want to know what is mandatory add to git repository, I mean that if I create a new project, versionate it and clone that repo in another computer, the project will work without problems.
Just the needed files I need to make my Android git project works in other computer when I clone my git repository. I am using Android Studio.
So, what files are mandatory to versionate on Android git project?

There is a great github project that includes gitignore files for every kind of project.
There is one for Android.
https://github.com/github/gitignore/blob/master/Android.gitignore
I always use this for my projects.

Related

How do I download a GitHub repository to an Andriod Studio project that I am currently working on?

I am working on an Android Studio project and I would like to add a getup repository to the current project. I am using a Mac.
I have downloaded the Github repository and unzipped the folder and was able to create a NEW project using the GitHub repository in Android Studio, but I do not know how to either
A) merge the two projects in Android Studio so my initial project can use the new GitHub Repository Project.
or
B) if I did this process incorrectly and I need to add the GitHub repository directly to my initial Project. I just don't know how and I have looked everywhere for the answer. Any assistance would be fantastic.
I found this answer about merging projects, but I do not know where to find my projects "module root"
You may refer to these 2 links, 1 and 2 for elaborations.
First of all, open the project you want to push in Android Studio.
Click VCS -> Enable version Control Integration -> Git
There doesn't seem to be a way to add a remote through the GUI. So open Git Bash in the root of the project and do git remote add
Now when you do VCS -> Commit changes -> Commit & Push you should see your remote and everything should work through the GUI.
If you are getting the error: fatal: remote already exists that means you already added it. To see your remotes do git remote -v and git remote rm to remove.
You may also refer to here and here for more understanding.

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
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.
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
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:

Use github library with Android Studio

I am currently using a library found on github, which our client is updating daily.
Right now, I have cloned the repository, imported the project as a separate module, and I have been able to use it just fine.
However, when the client updates the library, I have to sync, remove the module from my project, and add the updated one.
I should mention that I have to use the github app, cannot use the system embedded in Android Studio.
Is there a way to do this better?
imported the project as a separate module
If, in addition of declaring it as a "module", you import that project as a git submodule, then you can make that submodule follow a branch, and a simple git submodule update --remote would be enough to update the project sources.

Move from Android Studio back to Eclipse

I installed Android Studio and followed the export instructions laid out at d.android.com on how to move existing Android Applications over to Android Studio. I made the mistake of thinking that I would be able to use both editors for my projects. What would be the easiest way to move all of my projects and libraries back to eclipse? As of right now, my eclipse workspace comes up empty. Thanks
you can use both at the same time but you need to do some extra work by using version control (for example git). An example of how this might work:
You make an empty project in Git. You then clon your git project to local. In the local folder you create your new Android project. You then make a .gitignore where you ignore all eclipse related files/folders. Now you can publish your project to git. Then you clone your git project to a new folder, this is where you studio edition is going to go. You then make a new .gitignore in the new folder for the studio related files/folders.
Now you have version control and you can use both Eclipse and Studio.

Git on Windows 7 for Android in Eclipse: How do I use version-control on existing project?

How do I take my existing project in Eclipse on Windows for Android and put it inside a branch on a repository for Git? I also want to share this repository with my friend to help code. He already set up a Git repository and sent me the address and credentials. I just don't know how to go about this?
Once I get a cmd line for Git on Windows what do I have to do to add/clone this project to my friends repo or my own (then how do I share my repo with him?). I use Git with GitHub in Ubuntu (I didn't set it up) but I don't really know how to set this up.
I've already installed a plug-in egit and have had issues with that. I would like to use a separate interface from Eclipse for Git now.
Bones of the Question: How do I get my existing Android project into a Git repository that IS NOT a plug in to Eclipse?
Download msysgit from http://code.google.com/p/msysgit/
Download TortiseGit https://tortoisegit.org/. If you're using private keys, make sure you select Plink instead of openssh. I've had problems with OpenSSH for Windows.
Add your private key, if you're using it, to Pageant (included with Tortise Git).
Clone your repository with Tortise Git.
Copy all your files into the new directory.
In the Tortise Git context menu, select Add.
Select All
Commit
Push
That would be the short instructions.
Also, if you're comfortable with the command line tools, msysgit includes Git Bash, which is kinda like using Git in Linux.
http://nathanj.github.com/gitguide/tour.html this is a nice tutorial on a gui version of git. in your case you would do a git clone from the existing url that your project is stored in or create a new repository if you havent set one up on github yet.

Categories

Resources