- Home /
Unity on github
I just downloaded my project repo from github and openened it with my laptop.
All references in the editor are gone. My scripts are all marked as "missing". The meshes have lost their textures. My materials are blank. The prefabs have turned a sickening lila colour. And the terrain complains that "Terrain splat 0 is null" - that's a little understatement since all terrain splats are null. Just as all terrain textures/trees/details...
I browsed the forums and found different results. It seems that Unity projects in general are portable and can be used on different computers. This question seemed like a duplicate
http://answers.unity3d.com/questions/258684/Is-a-Unity-project-portable.html
but reimporting all assets didn't solve the problem.
I have to admit that I didn't copy all project files. This is a team project and we added the following gitignore to the repo on github: http://pastebin.com/E1A5Z1yA The idea was that without a gitignore there would be merge conflicts in the temporary editor settings files. Now I fear that the gitignore has prevented the syncing of important files.
What can I do? Is there a way to solve the problem without access to the full data? What gitignore would you recommend? My friend said that the standard github unity gitignore wouldn't be sufficient.
you may have to, also, use Asset Serialization. note the setting in project settings, editor and search about it on here
Can you use Github without doing an .gitignore file? To expand what condition is it okay to do this? Just one person accessing on one computer? Thank you for the post it was what I was looking for. I would vote thumbs up but don't have the rep yet.
Answer by Rabbit-Stew-dio · Dec 27, 2012 at 11:49 AM
By ignoring the whole Library directory, you are removing the mapping between Unity's metadata and the scripts/assets. Each script and asset has a unique ID, and when that is lost, you loose all prefab associations.
This blogpost (well, the last comment on it) describes a better .gitignore file.
*.sln
*.userprefs
*.csproj
*.pidb
*.unityproj
.DS_Store
/Library/FailedAssetImports.txt
/Library/cache/
/Library/previews/
/Library/ScriptAssemblies
/obj
/Temp
Answer by a436t4ataf · May 27, 2013 at 01:54 PM
As the author of the blog post, I did some more trial and error (and got feedback from other Unity devs). Eventually we got to this, which seems to work best:
##################
# Unity ignores:
#
# !!! WARNING !!!
#
# … you MUST convert Unity to using Metafiles *before* you start using this
# .gitignore file, or you WILL lose data!
#
# OS X only:
.DS_Store
*.swp
*.Trashes
# All platforms:
Library
Temp
*.csproj
*.pidb
*.unityproj
*.sln
*.userprefs
Hi @a436t4ataf , I am currently dealing with this problem and my current gitignore is https://github.com/github/gitignore/blob/master/Unity.gitignore . I noticed that there are quite some differences, so would you tell me if it's better or worse, in your opinion and why? I'm eager to find out so in order to deal with less bugs later in the course of dev of my project.
it's tremendously easier to use subversion with Unity. just get an svn repo on xp-dev or whatever.
@Fattie, What are advantages of using svn ins$$anonymous$$d of git with Unity? If it's about the learning process, we're already half over it and just starting already the project developement with gitlab. Or is it about compatability with Unity? If it's the compatability, are we really going to deal with a lot of issues when using git ins$$anonymous$$d of svn? Git vs svn
Long story short I like both features but like much the git ones. I think they are going to be much more suitable for our needs. We've got no problems with the complexity. Eventually by trial and error we will learn well enough to work with it on a higher level. What could the problems be using git(with Unity) so that it makes us switch to svn?
unity projects are all about gigabytes of pictures of explosions. git is for literally source code, it's the only thing git was ever good for
$$anonymous$$ap, in the age old "git versus.." dilemma. Here's the thing. the advantage of git is that ... "git works offline". but that is .. .stupid. nobody cares. purely fundamentally that's the one and only "awesome technical" advantage of DVCS over an ordinary modern (ie, "not 30 years out of date") version control system. for me basically, it's staggering - amazing - that anyone would put any time in to source control. (we would no more think about it here than we'd think about the power strips on the floor, you know?) by all means if you're sort of a cool hackerz genius, and you want to show off, use git - you know? it's sort of like that. but in the normal world, as it were, youjust right click and click "commit" (or maybe "ignore" if its the Library folder) in tortoise and nobody thinks about it any more than that! i think that's the deal dude
Answer by Fattie · Mar 11, 2015 at 03:31 AM
git is for, well, bad ass hard core programmers from 1960. subversion is an easy consumer system.
you can't even compare the two. git involves concepts like knowledge! techniques! maintenance! files! commands! etc.
in contrast with svn you just click once ("on the web") to install Tortoise, and then you "right click on a folder" to commit or update.
if deciding between the two, just click to download TortoiseSVN (for your Windoze) or Versionsapp for your Mac.
make a repo on xp-dev or whatever, and try it.
(so, "try it" means "right click on a folder"- that's all there is to it.)
Again they're not even in the same league,
git == like writing your own web server using c++ on a lamp stack
svn == like using an iPad to watch youtube
every single unity project we've ever been on, FWIW, has been svn.
Unity projects are just stupid little scripting projects with gigabytes of audio, etc, and one or two trivial scripts. git is really only made for literally computer source code (ie, small text files)
Just FTR consider PlasticSCM which is literally made for Unity. (it's probably better to use than subversion, but everyone just uses svn, its so easy)
BTW DONT FORGET TO !! ignore your "Library" folder, heh! (so, in tortoise, right click and select the shiny "Ignore" logo) (on a mac, same in the VersionsApp, rather than on the actual folder)
Actually git is really user friendly if you use something like github, and is great for handling textures/sounds/basically all assets. Of course if you want to go the hacker way you can also fire up a ter$$anonymous$$al and use that with git, but if you don't want to learn commands, just download Github's app.
And btw git is decentralized, so if the server shuts down or your computer explodes, you're safe. Of course not it both happen ;)
I'm not sure why you're so hell bend on putting git down.
subversion is an easy consumer system.
Nonsense. Git is as easy, you just need the right front-end tools ( like tortoisesvn ). As a matter of fact tortoiseGit has the same interface but ins$$anonymous$$d of svn you have git. So it really shouldn't be an issue and it completely obliterates your argument.
git == like writing your own web server using c++ on a lamp stack
svn == like using an iPad to watch youtube
Stop spreading misinformation please.
As a programmer I want the whole project, assets as well as source code to be on the repo. At least with git I can safeguard my files before I pull by committing to my local history first. You shouldn't prioritize textures/models over code. It's a terrible reason to use X over Y. If non programmers can work with svn then they can work with git.
We have migrated to git not so long ago at work and programmers as well as artists have absolute no problem using SourceTree or if they prefer TortoiseGit. We don't touch the command line tool at all.
git involves concepts like knowledge! techniques! maintenance! files! commands! etc.
So does svn if you use it solely as a command line tool. Not sure what you're getting at.
maintenance!
What a terrible thing to do regarding your project. lel