How can I prevent eclipse from randomly adding .gitignore files everywhere? - eclipse

eclipse keeps adding .gitignore files to my project that contain the following random list of files:
Thumbs.db
.DS_Store
.gradle
build/
out/
.idea
*.iml
*.ipr
*.iws
.project
.settings
.classpath
/bin/
I know which files I want to keep out of source control. I don't need my IDE to try to second guess me.
Where is the configuration option in eclipse that prevents it from creating .gitignore files.

I mentioned before (2014) the setting "Window → Preferences → Team → Git → Projects → Automatically ignore derived resources"
See if that would still have an incidence in your case (with, I presume, a much more recent Eclipse version)
This was also described (more recently, in 2020) in "Eclipse: Prevent creation of .gitignore for generated code" from Thomas Trocha

Related

gitignore for folder of eclipse projects

I am working following a set of java swing tutorials, each is an Eclipse project, keep them in a workspace. I init a git repository in the workspace folder (mac), and upload to github. When I download this folder in another computer (linux), the projects are not recognized as such, and opening/importing in Eclipse fails. Says: 'Folder not recognized as project'. What is the best way to handle a collection of projects in git?
If you want to have all of your Eclipse project data across your machines, you will have to add the following files/folders to Git:
.classpath
.project
.settings (folder)
Make sure that these are not ignored in either your local or globale .gitignore files.
Ignore things like the bin and target folders, since they contain the compiled classes and shouldn't be added to Git.
Regarding the failed import: as #nwinkler writes, Eclipse looks for the .project and .classpath files so you need to add them (and the .settings directory) to your git repository.
Regarding .gitignore, I typically put the workspace stuff there (and then do import existing projects in eclipse after cloning):
That is,
.metadata/.plugins
.metadata/.lock
.metadata/.log
and then for each project, the bin folder
project_dir/bin
and any other generated files

How do I ignore this Eclipse file in Git?

I tried adding it to my global .gitignore but it is still showing up as an untracked file when I do git status.
researchProject/.externalToolBuilders/org.eclipse.wst.jsdt.core.javascriptValidator (4).launch
I disabled the JavaScript validator because it kept giving my build errors -- the only solution I found was to disable it.
add the following lines to your .gitignore file:
.project
.settings
.classpath
.metadata
and for your case also
.externalToolBuilders
and you should be good to go.
Do not add .project and .classpath to .gitignore if you are working on an eclipse-specific project.

APTANA: Ignore .project file when uploading?

I'm new to Aptana and I noticed that when uploading via FTP or checking in a project through SVN, it also uploads / checks in the .project file. I did hide this and other hidden files in the Project and App Explorers but for some reason the .project file still uploads when deploying a whole project. Any suggestions?
If you use command line SVN client (like CollabNet Subversion on Windows), go to your project folder which contains .project and .classpath file (we usually ignore both with some other IDE generated folders/files), this is the command to add a specific file to SVN ignore list:
> svn propset svn:ignore -F .project
If you use GUI SVN client (like TortoiseSVN on Windows), ignore function is usually integrated into Right-Click Menu, right click the file you want to ignored then choose TortoiseSVN -- Delete and add to ignore list).
Check out the ignore section in SVN user giude here.

SVN on Eclipse still try to synchronize eclipse .settings directory despite svn:ignore flag

In my python/pydev project home directory, eclipse create 3 files/directory :
.settings
.project
.pydevproject
As I do not want to share these files, I set a svn:ignore flag on the home project directory with these 3 files/directory specified in it.
It works well for .projet and .pydevproject, but not for .settings :
From time to time, .settings reappears into the "team synchronize perpective" as to be synchronized/committed into the svn repository.
How can I get the eclipse '.settings' definitively ignored during svn commit in eclipse gui ?
Do you have checked in .settings before adding it to ignored? If so, you should remove it from svn (not the working copy of cause).
If the .settings folder was previously under SVN (i.e. commited) then you should remove it from you SVN first.
If you still want to keep it in your working copy, you can do:
svn remove .settings --keep-local
in command line, and do svn ls (if you see this folder listed, you haven't removed it from SVN!!!)
If you already removed it and still have a problem you can try one of 2 things:
1. Deleting the folder manually (assuming no complex\unique settings were made)
and letting Eclipse recreate it
2. Deleting only the inner folder `.svn` (only the one inside .settings),
and then running svn cleanup (Team -> Cleanup)
The first one is preferred, since it is never the best idea to mess around with SVN's files.
You can (and should) exit eclipse, back this folder up, and update your working copy before this process.
if you have installed subversive you should also install the "subversive svn jdt ignore extensions".
you will find it here:
help > install new software ...
select your eclipse download site. in my case its "Helios - http://download.eclipse.org/releases/helios"
you'll find it under collaboration > Subversive SVN JDT Ignore Extensions (optional) (Incubation)
That sounds you have sometimes added this folder under version control and checked it it. You need to first removed it (svn rm via command line or via TortoiseSVN on windows) and do a commit. This needs to be done outside from Eclipse. After you changed that you can start Eclipse again.

eclipse+bzr (Or: DVCS + IDE)

I have some projects on bzr code repositories shared with colleagues.
Problem is, I really want to switch to eclipse in some projects, but I don't want to pollute the repository with the unnecessary metadata eclipse creates in its Workspaces.
Any idea how to keep Eclipse's metadata outside my bzr repo?
Adam
If you know the names of the meta files created, you could put them into your .bzrignore file in your repository's directory.
See this part of the bzr docs
All the main metadata in eclipse are in the workspace.
You project, meaning:
your .project file
your .classpath file
your .settings directory
your source files
should all be located elsewhere, within your main project directory.
All those files (except the .class files generated by the compilation) should be versioned.
See "Do you keep your project files under version control?" for more, but also:
What to put under version control?
When working with Eclipse, should I add the workspace to the source control?