Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What to check-in from an Eclipse workspace .metadata

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?

like image 719
srf Avatar asked Jan 19 '23 05:01

srf


1 Answers

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.

like image 166
Andrew Eisenberg Avatar answered Jan 29 '23 11:01

Andrew Eisenberg