Is there a way to delete an Eclipse project while preserving all the resources? (i.e. source code, etc.).
I guess I could delete the following files from the project directory manually:
.cproject
.project
But I am concerned that my Eclipse .metadata information that lives in my workspace may still look for those files and get confused if I delete the project files manually.
What I usually do is remove the project using eclipse (do not delete project contents on disk) and remove any .* eclipse-related file that could stay.
With the checkout unchecked, it deletes the project informations while preserving the source code.
Related
I want to make copy of an existing eclipse project A and customize it and check it in CVS as a second project B. So I manually copied the entire project A directory into another workspace and opened the project in eclipse. Made changes (removed bunch of files), now when I try to check it in CVS, it somehow recognize it as project A and not a new project B. Seems like I copied some file that tracks the root. How can I remove it so I can check in as project B in CVS?
Even if I try to import the projectB in a different workspace in eclipse, I get the message, project already existsand identifies it as projectA.
See if you can unshare the project through the UI. You likely have the original CVS directories that point back to the existing location.
I have a project in Eclipse Oxygen that uses Git. When a file is created or edited it shows in the Unstaged Changes list on the Git Staging View. This allows you to drag the file to the Staged Changes list and then it can be committed.
I needed to create a folder named .sti directly under the project folder and then a folder named bin under that, like this:
project/.sti/bin
Then I had to create a file called assemble in the .stl/bin folder.
The problem is that the file called assemble does NOT show in the Unstaged Changes list. Therefore I cannot stage and commit it.
Is there any way of getting this file to appear?
I'm sure that the .sti folder is the cause of the problem.
Any ideas or help would be much appreciated...
In the end I deleted the .gitignore file in the project folder and recreated it. Upon refreshing the project in Project Explorer, the changed file appeared in the Unstaged Changes.
This was rather strange as the original .gitignore did not specify: .sti
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
In my Eclipse workspace I've noticed the .metadata folder keeps growing. Should I regularly delete this folder? What would be the consequences of it?
Apart from that, what information does the .metadata folder contain?
Deleting all the .metadata folder would remove all your project references from your workspace.
If your project is actually stored completely in the workspace (i.e. its sources are stored in the default workspace path), you would also lose your project contents as well - which is worse since you wouldn't be able to re-import them.
I always recommend to keep your Eclipse project and its sources separate from the workspace.
See "What is "src" directory created by Eclipse?".
That way, the settings specific to your projects are saved within your project (in the .settings directory), and not in the workspace.
Also, you need to move your launcher definitions in your project as well.
In that configuration, you can delete a workspace without much damage and simply re-import your project into a new workspace.
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?