4

I have been version-controlling the projects under my workspace but it never occurred to me that I should be checking in the workspace configuration itself.

Until now.

I know that I have absolutely no interest in the perpetually bloating .log file, so I am definitely not going to check it in, but... can I discard other other subdirectories or files? Should the .lock (size 0) be checked it? What about the .plugins subdirectory?

srf
  • 2,410
  • 4
  • 28
  • 41

2 Answers2

8

Short answer: do not add .metadata to VCS.

Long answer:

There are two general reasons to do version control (this is a slight over simplification):

  1. to share your projects with other developers
  2. to ensure that you have backups in case your hard drive goes kaput

If you are using version control for the first reason, then there is nothing in the .metadata directory that should be versioned. This is because the information there is specific to your machine and would mess things up if other machines tried to use it.

In you are using version control for the second reason, then I would still recommend against versioning the metadata (although slightly less strongly). Much of the information in the .metadata is binary, or at least extremely uninteresting to read. So, you will not need to go back versions, do any diffs, or anything like that. Instead, I'd recommend just using a proper backup service that backs up your entire computer in case of an emergency.

Andrew Eisenberg
  • 28,387
  • 9
  • 92
  • 148
  • 1
    Thanks for an enlightening answer. Accepted, although I do get a heart attack every time I check out a project to a new workspace only to see numerous errors in the build... I then have to scramble frantically for any clue that can remind me what I did in the past (sometimes years ago) to make the project build without errors. – srf Jul 12 '11 at 19:19
  • 1
    @Andrew: Are you saying .metadata is a derived file? That the IDE creates it from the other files in the project? If that's true, then I'd agree entirely that it shouldn't be in version control. – tomlogic Jul 12 '11 at 19:31
  • 1
    @tomlogic: The .metadata folder contains one part system-specific settings (Window->Preferences) (full of absolute paths) and one part temporary/working files. Any metadata that can be safely shared is in the projects. – Konstantin Komissarchik Jul 12 '11 at 20:05
1

There would be one good to reason doing this : versioning the working set file, to share project lists efficiently between teams.

sancelot
  • 1,905
  • 12
  • 31