Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

In an automatically created libgdx project, what files can I safely tell Git (or other revision control systems) to ignore?

I'm considering these:

*-android/.settings/
*-android/bin/
*-desktop/.settings/
*-desktop/bin/
*-html/.settings/
*-html/gwt-unitCache/
*-html/war/WEB-INF/classes/
*-html/war/WEB-INF/deploy/
*-html/war/assets/
*-html/war/
*/.settings/
*/bin/

Am I missing some? Is there a complete list somewhere?

share|improve this question
    
Generally, you want to put all what is needed to easily rebuild the project on your repository, whatever you are using SVN, GIT, Mercurial etc. A good practice is to avoid adding the result of compilation (e.g .class and .jar in your case). The sources and the different backend configurations should be enough. You could easily generalize your question (and ask it on the SO site) to any project using tools such as GIT, nothing specific to libGDX here. –  nathan Dec 4 '12 at 8:23
    
@nathan, I know the theory, but I use Eclipse I don't know what files can be generated and what are uniques in this case. –  Zhen Dec 4 '12 at 8:47
    
Maybe you can find some inspiration in this? –  Laurent Couvidou Jan 31 '13 at 15:30

3 Answers 3

up vote 8 down vote accepted

Ignore all the /bin/ directories (they contain files generated from sources). The /war/ directory hierarchy is similar (generated files for the GWT/HTML backend).

You can ignore the /.settings/ directories, as they contain Eclipse settings, and are not required to be able to re-build your application. (These are probably a bad idea to push into git if you expect to work with other developers, as they tend to have local paths in them.)

On the Android side, you should also leave out the gen directory

For the Eclipse .project and .classpath files see http://stackoverflow.com/questions/2818239/classpath-and-project-check-into-version-control-or-not (the answer there seems to be "yes, include them if using at least Eclipse v3.5").

share|improve this answer

The new project generator comes with autogenerated .gitignore file like:

## Java

*.class
*.war
*.ear
hs_err_pid*

## GWT
war/
html/war/gwt_bree/
html/gwt-unitCache/
.apt_generated/
html/war/WEB-INF/deploy/
html/war/WEB-INF/classes/
.gwt/
gwt-unitCache/
www-test/
.gwt-tmp/

## Android Studio and Intellij and Android in general
android/libs/armeabi/
android/libs/armeabi-v7a/
android/libs/x86/
android/gen/
.idea/
*.ipr
*.iws
*.iml
out/
com_crashlytics_export_strings.xml

## Eclipse
.classpath
.project
.metadata
**/bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.externalToolBuilders/
*.launch

## NetBeans
**/nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml

## Gradle

.gradle
build/
share|improve this answer

You can have separate .gitignore files for each folder. So you can put a specific Android .gitignore on the Android project and so on. Without worrying about libgdx in general.

Github has good pre-made templates for Android and GWT (which libgdx uses for the web version). You could just use those and place each on their specific directory.

List of templates: https://github.com/github/gitignore

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.