git and eclipse workbench

I’m totally new to git and have a question related to the work bench. I do stuffs in java so I would ask in term of java. When you commit files to git repository, do we commit .java, .class files? Or it is ok to put the whole work bench into the local git folder then commit everything?

  • What does the red exclamation point icon in Eclipse mean?
  • Eclipse git cannot finish rebase
  • git eclipse always have to pull allready updated project
  • How to merge my local project with a github project?
  • Cannot install Subversive SVN Team Provider
  • What's the fastest way to get all build errors in a Java project?
  • How to get diff for specified user between two dates from git?
  • How to gitignore *only* files?
  • git: Create new local branch without any local un-committed change
  • Executing git commands on a bare repository
  • How am I supposed to work with multi-module Maven projects with EGit?
  • git commit error with sublime text 2
  • One Solution collect form web for “git and eclipse workbench”

    It’s generally not considered a good idea to commit binary files to any version control system if you can recreate them by simply compiling the source code you also committed. This is especially important with a DVCS as every copy of the repository carries around the redundant data. This might not be a big deal if you’re working on a fairly small project, but once the project gets bigger it’s a nuisance.

    The other problem with committing the .class files or any sort of binary is that any sort of build will show your source tree as “dirty” in multiple places unnecessarily as both the class files and the java files will need comitting.

    My advice would be to put the build directories in your projects in .gitignore so git knows not to look at them, then add your source files and the Eclipse project files to git.

    Git Baby is a git and github fan, let's start git clone.