Giter Club home page Giter Club logo

Comments (6)

JanMosigItemis avatar JanMosigItemis commented on May 12, 2024 1

Hi there,

sry for opening up this issue again but I think the decisions on .project and .classpath need to be reevaluated. I do develop Java projects with Eclipse for a living and I never had a case where it was required or even useful to keep those two files in the code repository.

The idea for any IDE is like this:

  1. git clone the repo
  2. Build it
  3. Import it into your favorite IDE

The IDE's importer is supposed to create reasonable defaults. In my experience the chance for error increases if new developers check those files out and then try to import the project rather than letting the IDE's importer do the work.

It seems that over the years, .classpath was removed from the template. Thus, the Eclipse template now has .project commented out and no entry for .classpath.

Also the .classpath is regenerated on each project Maven update in the Eclipse IDE, so it really does not seem to be reasonable to keep them.

I'd advocate for including both of those files per default into the Eclipse template. Any thoughts on this?

from gitignore.io.

joeblau avatar joeblau commented on May 12, 2024

It is supposed to be like that. If you look at the master gitignore repo Eclipse.gitignore template hosted by GitHub, you'll find that the eclipse file doesn't ignore those two files.

The reasons for keeping them are outlined in this Stack Overflow post

from gitignore.io.

Sheparzo avatar Sheparzo commented on May 12, 2024

Please revisit this topic for a moment with me. Or I could open a new issue if you wish. I think there is a strong case to be made for git not tracking .project and .classpath and putting these in the .gitignore.

I recently performed large conversion for an organization's VCS from CVS to Git and at the same time I converted all of their webapps to multi-module Maven projects. I initially tried to have Git track these two files based on gitignore.io and the StackOverflow post you mentioned. But I ended up removing these from git tracking and adding them to the .gitignore file.

The reason is because Eclipse sometimes rewrites these files like during a Maven update based on the project pom.xml. I had instances where two separate developers did a maven update and contents of these files would be slightly different between their two systems and they would be constantly overwriting each other's .project and .classpath files.

Really there is no need for the .project and .classpath files to have been committed to git in the first place since Maven handles these.

So when it comes to Eclipse and if you use Maven, I'm advocating for at least a comment message in gitignore.io generator for Eclipse that would say something like "If using Maven, you may want to ignore these files." And then list the files commented out by default like you've done for some of the other tools.

# If using Maven with Eclipse, then you may want to ignore these files:
#.project
#.classpath

Please reference these posts as additional arguments if favor of ignoring .classpath and .project files

from gitignore.io.

joeblau avatar joeblau commented on May 12, 2024

There is already an issue to create a .patch [#36] file format so that we can augment the master git repository by adding/removing certain lines. I just haven't gotten around to adding it yet and no one has submitted a PR. Once the .patch files are in place, we will be able to fix this.

from gitignore.io.

joeblau avatar joeblau commented on May 12, 2024

Added .patch format so the .project and .classpath are now appended to the Eclipse .gitignore template file.

from gitignore.io.

Sebastian-Pietrzak avatar Sebastian-Pietrzak commented on May 12, 2024

Cheers!

from gitignore.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.