|Re: Using Eclipse (Windows) with git plugin [message #993692 is a reply to message #993537]
||Tue, 25 December 2012 06:32
| Russell Bateman
Registered: July 2009
Location: Provo, Utah, USA
On 12/24/2012 11:41 AM, Dennis Putnam wrote:|
> No, I didn't think they should be included, at least on the central
> repository since they only apply to Eclipse and my Eclipse at that.
> Would collaborators necessarily use the same one? Can/should I put them
> on the local repository but have them excluded from the central? I
> haven't played much with .gitignore but what little I have tried doesn't
> seem to work.
Without .project and .classpath, it's not really an Eclipse project. You
must have them.
I understand what you're saying about collaborators using the same ones.
I had these identical concerns when I started off using source-code
control, Subversion, for Eclipse projects. I have done it the wrong way
and the right way. There should not be host-specific paths in either
file and both files should be committed and pushed all the way to origin
You shouldn't have to worry about .project. All your collaborators
should be working on the same project from every point of view and not
adjusting the project independently from the others.
However, you do have to worry about .classpath. You must be careful not
to add library JARs, for instance, that lie outside your project. (If
using Maven, this shouldn't be a problem. I don't use Maven.)
Even when setting up Build Path with JARs from, say, a subdirectory
underneath your project (and therefore committed), it's possible to
generate host-dependent paths when you wire up source code or Javadoc
for the JARs in your classpath. If you're exceptionally interested in
this, see http://www.javahotchocolate.com/tutorials/git-eclipse.html .
So, yes, commit .project and .classpath changes to master and each
collaborator should pull them with no problem to his individual master
and branch copies.
..gitignore works pretty much as .svnignore and .cvsignore.
If you wish to exclude files or subdirectories, such as .class files
that are built by the compiler and should not be committed, just add the
path from the root of the repository (which is the same thing as the
root of the Eclipse project).
Powered by FUDForum
. Page generated in 0.05179 seconds