I am building an Android app using Eclipse and git. Everytime I do a commit I see changes in files I am not shure I need to track (for instance, some inside the bin folder). Which folders can git safely ignore in this kind of project?
1 Answer
You can use gitignore.io to build a .gitignore file that suits you. Using the Android, Eclipse and Java tags, i got this:
# Created by http://www.gitignore.io ### Android ### # Built application files *.apk *.ap_ # Files for the Dalvik VM *.dex # Java class files *.class # Generated files bin/ gen/ # Gradle files .gradle/ build/ # Local configuration file (sdk path, etc) local.properties # Proguard folder generated by Eclipse proguard/ ### Eclipse ### *.pydevproject .metadata .gradle bin/ tmp/ *.tmp *.bak *.swp *~.nib local.properties .settings/ .loadpath # External tool builders .externalToolBuilders/ # Locally stored "Eclipse launch configurations" *.launch # CDT-specific .cproject # PDT-specific .buildpath # sbteclipse plugin .target # TeXlipse plugin .texlipse ### Java ### *.class # Mobile Tools for Java (J2ME) .mtj.tmp/ # Package Files # *.jar *.war *.ear # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* gitignore.io uses the templates available at the gitignore project on GitHub.
6 Comments
Pedro Gonzalez
Good. Following your advice I found this GitHub repo with templates for each language link
dcastro
@PedroGonzalez Yeah, I added a link to the repo to my answer ;) The gitignore.io website combines those templates and generates the corresponding .gitignore file.
Pedro Gonzalez
is it safe to add the .gitignore file long after the project has been started? Will files that have been already tracked be a problem?
dcastro
@PedroGonzalez Well, files that have already been tracked will remain on the git repo. Subsequent changes to those files will be ignored. Search on stack overflow for something like "remove tracked files from git repo", I'm sure there are plenty of answers.
dcastro
@user2103379 You put it on your repository's root folder.
|