Hello! I'm trying to use git for external version control with Unity Pro. I found this page in the manual, which gives a list of Library files that should be tracked. But I notice that the manual page was last modified about a year ago (2010-08-10), and I'm running Unity 3.4 (which was released later). Does anybody know if the manual's list of files-to-track is up to date? I'm wondering about files like BuildPlayer.prefs, EditorSettings.asset, EditorUserBuildSettings.asset, and others.
Also, does anyone know if *.unityproj files should be version tracked?
(Although I'm using git, I expect the same question would be applicable to users of svn, Hg, or other version control systems.)
Thanks in advance!
Answer by PaxNemesis
Sep 15, 2011 at 11:16 AM
The information on that site should still be accurate. You should probably add the *.unityproj files and everything else in the directory you want to version control(except the obj and Temp directories). Though neither GIT nor any other version control system can do any accurate checks on files that aren't plain text.
Answer by lcbrett
Sep 15, 2011 at 03:47 PM
Thanks, PaxNemesis! I also have some *.sln files in that directory, which I assume are MonoDevelop solution files. I've read that those should also be ignored by version tracking. Have you heard differently?
In case you're interested, git is reasonably smart about binary files. It can be configured (1) not to diff them, (2) to use an external diff tool, (3) to convert them into text files before diffing them (depending on the file type, of course), etc. It's pretty handy. See here for details. There's even an extension called git-media that lets you use git to version track your big binaries while storing the binaries themselves outside of git, which keeps your repos lean and fast.
Glad to be of help. There should be no need of adding the *.sln files as they will be recreated when you open the project through Unity.
Ah, haven't used GIT on anything other then code yet myself. But handy to know, I will check it out. Thanks for the info :)
Answer by XaeroDegreaz
Feb 25, 2013 at 08:40 PM
I know this is a bit late, but have you tried using Git UniTEAM from the Asset Store? It's an editor extension that lets you manage your Git versioned project.
Answer by AnomalusUndrdog
Apr 08, 2013 at 12:53 AM
I don't version control *.unityproj (or .csproj) because I know MonoDevelop can recreate those when not found. Those files are only used by MonoDevelop, and it's entirely optional to use MonoDevelop when coding for Unity anyway (I just use other text editors). So I don't like putting that in.
They're not really critical, and you won't lose anything if you don't include it in version control. AFAIK .unityproj is simply a list of .js files in your project, so MonoDevelop can show a listing of them in its IDE. You can recreate/refresh that file by going to the Unity Editor then click Assets > Sync MonoDevelop Project.
There are other files that MonoDevelop creates, like session files that say what files were last opened, so MonoDevelop can open them when you run it again. You surely won't want to version control those.
Answer by HamsterCrack
May 16, 2014 at 12:08 AM
I use the following .gitignore and it works pretty well. You'll have to make your own decision about .sln and .csproj. I like including them, but they are not necessary since they are auto-generated. However, with the .sln since I use UnityVS it's best to commit to save some of the settings.
# Unity Builds (save on storage space)
# ---------------[ Unity generated ]------------------ #
# Unity crash handler generates
# ----[ Visual Studio / MonoDevelop generated ]------- #
# UnityVS generated from .pdb files
# -------------[ OS generated ]------------------------ #
# Vim generated? Not sure
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
6 People are following this question.
Does Git or SVN work better with Unity?
.hg folder huge, causing issues with BitBucket
SVN Update problem
Unity & subversion (without Unity Pro)
Can a non-pro user serialize their assets to text instead of binary?