Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We are experiencing some problems with GIT and Unity. It occurs pretty often that file .sln / .csproj give us some trouble, so after searching for a while on the web I've found that maybe this files are not necessary to push. Someone have any feedback for this? There for example are included into the .gitignore, but I honestly don't know what this kind of files does.

Can I exclude they from my repo or this file are relevant for some references in my game?

share|improve this question
up vote 17 down vote accepted

From my personal experience, I noticed it is better to exclude *.csproj and *.sln from source control: Unity generates these files each time you open a project or add/delete source files anyway, so you won't miss them. You can also do it manually via "Sync MonoDevelop Project" menu item.

It is especially useful to exclude them if there is more than one developer on the project, because the auto-generated content of these files can be different for each user (that depends on Unity installation path and probably some other factors), which may cause a lot of unnecessary file changes committed to the repository.

share|improve this answer
+1. These get regenerated all the time. Gitignore them. – michael.bartnett Feb 28 '13 at 15:12
You should also be excluding the entire Library/ folder. – michael.bartnett Feb 28 '13 at 15:19
Thank you both for the reply :) – Max Feb 28 '13 at 15:30

I never check in the .sln or csproj. I only check in the actually unity project. Let unity manage the solution files for you. It can be a headache if some forgets to check in only one of the .csproj from the editor folder or something. So if a new coder comes in, they check out the repo and double click a file with mondevelop or vs.

I also make sure to do an Scn ignore on all those files too, so the artist don't check them in on accident to lol

share|improve this answer

You can safely exclude those files because they are automatically re-generated by Mono. The code inside those files is being read only from open files, not protected DLLs of, for instance, paid plugin.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.