1

I'm currently on a Unity project where there is a certain folder we can't commit, because it contains cached data that changes frequently, but is necessary for the application to run, and the last version must

Currently, we have to zip the folder, and commit the zip. This is obviously time-consuming.

Is there a way to make SVN or GIT "think" of a folder as if it were a binary file? Specifically, it would ignore the individual file tree inside that folder, instead processing it as one single chunk.

Is this possible? Is there another version control solution which can do this? Thanks.

(I was originally going to write a BAT file which would automatically do the zip and unzip, but seeing as Windows 7's onboard zipping utility is inaccessible from the command line...)

Tom Murray
  • 99
  • 10
  • Is only the folder necessary, or do you need a snapshot of the last state of the cached data in the folder as well? – Zeke Nov 23 '11 at 17:20
  • 4
    I don't understand the problem. If you could make git see that folder as a binary object, wouldn't that binary object change just as often as the folder tree changes? – kubi Nov 23 '11 at 17:24
  • Exactly like kubi says, and what's wrong with having the individual files under version control? – Shahbaz Nov 23 '11 at 17:36
  • And another comment is, if you want to zip something, download 7zip, it's much faster than windows (and most other) zip programs. It also has a GUI for your normal daily use – Shahbaz Nov 23 '11 at 17:40
  • Zeke - yes. Kubi and Shahbaz - we tried that already, it didn't work. It needs to process the folder as a whole object, which is why we need to zip it until we find a more eloquent solution. Shahbaz - That's a good suggestion, I'll try that :-) – Tom Murray Nov 23 '11 at 19:41

3 Answers3

1

I will guess that the folder you don't want to commit should be present but empty when you checkout.

If you're working with git you have to use the .gitignore file and specify that you want to ignore every file in this folder, this way they won't be commited. Here is the content of .gitignore:

*
!.gitignore

With SVN you have to use the propset on svn:ignore to ignore eveything in your folder:

svn propset svn:ignore "*" path/to/your/folder

If I'm wrong the other possibility is that you want to work with hooks. But unless you add a comment to this answer, asking for more information on hooks, I should not get into those details.


Resources:

Related topics:

Community
  • 1
  • 1
Colin Hebert
  • 91,525
  • 15
  • 160
  • 151
  • This might work - I'll have to try it. The problem with the Library folder is that it keeps track of scene objects and project settings - this would make it so any in-scene changes would have to be done manually by the person at the other end. But, worth a shot! – Tom Murray Nov 24 '11 at 00:07
0

Make sure you have "Meta" selected underneath "Edit > Editor > Version Control". This way, you can ignore the Temp dir, and the Library dir, and avoid versioning them altogether :)

Just version Assets and ProjectSettings, and .gitignore.

Also, have you tried using Git UniTEAM from the Unity Asset Store? It's an editor extension that lets you manage your Git versioned project.

Xaero Degreaz
  • 1,045
  • 11
  • 18
0

Make a .gitignore file in the folder containing just the line:

 !.gitignore

This tells git to ignore all the files in the folder, except the .gitignore file itself.

This way, it creates the folder but doesn't attempt to manage your cached resources.

Marsh Ray
  • 2,827
  • 21
  • 20