Should Eclipse-specific files in an VCS be ignored, if using Maven?

后端 未结 4 1744
轻奢々
轻奢々 2021-02-08 05:23

I know why not to commit Eclipse/IDE-specific files into a VCS like Git (which I am actually using). That is one of the reasons I am using Maven and having it generating these f

4条回答
  •  不思量自难忘°
    2021-02-08 06:02

    I agree on not putting the IDE files under version control, this occasionally causes all sorts of pains, and as you mentioned using maven renders this unnecessary as any developer can simply import the project from the POM and get going

    If these files are not put in the .gitignore they can easy be checked in by mistake

    furthermore I do not find listing them in the .gitignore makes it IDE specific, you can list project files of eclipse, IntelliJ IDEA, and Netbeans, all in the same .gitignore if your team members use a mix of different IDEs. Over time you may accumulate a template .gitignore that ignores project files from all IDEs used in your team(s) to use whenever you create a new repository

    If you are totally against putting these in the project .gitignore you can put them in the users .gitignore, but that in my mind is a bit looser as it depends on the individual development machines being configured correctly, and also these need to be maintained to be kept in sync with any new additions

    Edit: I currently have an equivalent .hgignore, same concept different syntax, I converted it to git as an example of such a .gitignore file

    /target/
    /bin/
    /build/
    /.classpath
    /.project
    /.settings/
    /.checkstyle
    /atlassian-ide-plugin.xml
    /.idea/
    /*.iml
    /*.ipr
    /*.iws
    *.orig
    *.swp
    *~
    

提交回复
热议问题