16

I ran into a few synchronization issues where I had to checkout my project a few times over.

A number of us are working on an android project and need to retain the proper package structure, resource files, etc... I think that all of these should be in the repository but the class/build files should be excluded, right?

Is it good practice for my team to ignore committing their .class files?

TankorSmash
  • 12,186
  • 6
  • 68
  • 106
Atticus
  • 6,585
  • 10
  • 35
  • 57
  • I always ignore them. We had some issues with this too, and the IDE will compile all, so I don't see a problem exclude them. –  Nov 23 '11 at 02:58
  • 4
    Anything generated by the build should be ignored, almost always. – Dave Newton Nov 23 '11 at 02:59
  • For more info take a look at http://stackoverflow.com/questions/417599/svn-best-practices-working-in-a-team – TonySalimi Nov 23 '11 at 05:09
  • I couldn't figure out a way to edit this so that the body and title are asking exactly the same question, because the answer is 'no and yes'. – TankorSmash Dec 09 '17 at 05:25

3 Answers3

28

Yes, .class files produced from .java files in the same project should be ignored.

Usually you want to have a separate build folder for all your .class files to go in, and then put that whole folder in .svnignore.

See: Which files do you commit and/or omit from your source control?

Community
  • 1
  • 1
wrschneider
  • 17,913
  • 16
  • 96
  • 176
7

You should put source in the repo but not things generated from the source. So yea, you should not commit class files. You should commit your build scripts, but not files generated by the build

Eric Rosenberg
  • 1,543
  • 9
  • 18
4

Generate files (build files, class files, etc) should not typically be placed into source control. It's best to add these to an ignore list, depending on your SCM.

Beau Grantham
  • 3,435
  • 5
  • 33
  • 43