I'm using mostly GIT, but I believe this doesn't depend on which one you're using, even if it's Asset Server.
Plus, in the last library rebuild, it bricked something on our lightmapping that I had to re-do. Nothing big, but all this makes me scared of getting bigger.
There are many things that will trigger a complete library rebuild, which can take over 10 minutes to complete:
The question is in the title: How to prevent the library to keep rebuilding itself like that? Would it work if I version it along, at least with the major versions? Is there something I'm missing?
I do realize next Unity will bring a "Library Network Cache", but that should solve just 1 of those listed items.
edit / update:
Actually this became a bigger problem already. I'm not fully using git thanks to it. Can't really go back in history to an old commit or different branch and test stuff as I'd like to. The 10 minutes rebuild, which was already too much, became over 1 hour. Maybe 30 minutes when Cache Server decide to work, in a best case scenario. Some times we need to go through, tho. And it sucks very hard. So, still missing a good solution here, despite the accepted answer!
Summary: don't let your version control system rewrite history or re-perform changes that were previously made.
Unity will always reimport assets if their timestamp changes. If you want to make a backup of your project to in case of accidental re-imports, you must copy all folders as well as timestamps. Windows/OSX copy functionality does not preserve timestamps, so you will need to use a helper application. (In OSX terminal or Cygwin, "cp -a" does the trick.)
When you check out on a new machine, the build platform isn't specified because you haven't checked that file in. Do it and you'll never have this problem. To find out where the platform build settings are stored, make a small project, change the build platform, and see which files changes. It's in Library/ or ProjectSettings/.
Here's a trick about using Git and avoiding reimports: Always keep a project backup (and backup when in a state where Unity doesn't need to re-import anything). If you do some Git operations (like svn dcommit or rebase) and your file tree ends up mostly the same as it was before besides that the modification times have changed, you can salvage the situation: use a syncing program like rsync to copy your whole project backup (except the .git folder) over your main project, deleting any differences (rsync -a --delete). At this moment, your recent changes will not be reflected in the working copy, so use "git checkout" and maybe "git clean" to iron out the differences. Now when Unity is opened, it will only re-import the files that are actually different, regardless of any changes that may have been done and undone.
Also, if you must rename an asset, do it within Unity and not the filesystem. That way Unity knows it doesn't need to re-import. (Your coworkers will still need to re-import that file/folder, so do this sparingly.)
It seems Unity 3.5 no longer supports files that begin with a period (a ".") so a filename such as ".somefile.prefab" will cause Unity some to have some issues.
The fix for this is to rename your file so that it no longer begins with a period.
Specifically I was having this problem with 2D Toolkit which creates a file called ".tk2d.prefab". Renaming this file to "-tk2d.prefab" and fixing up the tk2d codebase so that it loaded this file instead resolved the issue for me.
answered Jan 24 '12 at 10:24 PM