x


Unity with git for external version control

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!

more ▼

asked Sep 15, 2011 at 06:33 AM

lcbrett gravatar image

lcbrett
16 3 2 2

(comments are locked)
10|3000 characters needed characters left

5 answers: sort oldest

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.

more ▼

answered Sep 15, 2011 at 11:16 AM

PaxNemesis gravatar image

PaxNemesis
340 31 28 42

(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Sep 15, 2011 at 03:47 PM

lcbrett gravatar image

lcbrett
16 3 2 2

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 :)

Sep 15, 2011 at 08:40 PM PaxNemesis
(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Feb 25, 2013 at 08:40 PM

XaeroDegreaz gravatar image

XaeroDegreaz
16 3 3 5

(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Apr 08, 2013 at 12:53 AM

AnomalusUndrdog gravatar image

AnomalusUndrdog
265 8 10 18

(comments are locked)
10|3000 characters needed characters left

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/Dist/
 
 # ---------------[ Unity generated ]------------------ #
 Unity/Temp/
 Unity/Obj/
 Unity/UnityGenerated/
 Unity/Library/
 *.unityproj
 *.booproj
 
 # Unity/*.sln
 # Unity/*.csproj
 
 # Unity crash handler generates
 Unity/sysinfo.txt
 
 # ----[ Visual Studio / MonoDevelop generated ]------- #
  
 Unity/ExportedObj/
 *.svd
 *.userprefs
 *.pidb
 *.user
 *.suo
 *.opensdf
 *.sdf
 
 # UnityVS generated from .pdb files
 Unity/Assets/Plugins/*.mdb
 Unity/Assets/Plugins/*.mdb.meta
 
 # -------------[ OS generated ]------------------------ #
 
 # Vim generated? Not sure
 *.swo
 
 .DS_Store
 .DS_Store?
 ._*
 .Spotlight-V100
 .Trashes
 ehthumbs.db
 Thumbs.db
 *~
 *.swp
more ▼

answered May 16 at 12:08 AM

HamsterCrack gravatar image

HamsterCrack
0 1 2 3

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x59
x51
x7

asked: Sep 15, 2011 at 06:33 AM

Seen: 7939 times

Last Updated: May 16 at 12:08 AM