By default, you want to ignore anything that is automatically generated or downloaded. This includes compiler output (e.g. obj files), packages and components, user settings, etc.
Note that if you’re using Xamarin Visual Studio Extension, you probably want to base your .gitignore on a visual studio template.
This is what I use for my projects:
/NuGet *.apk *.ap_ *.dex *.class bin/ gen/ local.properties .DS_Store .idea/workspace.xml .idea/tasks.xml .idea/libraries .gradle /*/local.properties /*/out **/build /*/*/production *.iws *~ *.dll *.swp **/obj/ monotouch_dll_content_processed monotouch_trial arguments *.userprefs *.mdb Resource.designer.cs Components/ packages/
Use command line tools to restore components and packages
Since we don’t keep assemblies in the repository, we need a way to restore them.
There are 2 issues here:
- Xamarin Studio is not so good in restoring dependencies. Most of the time it fails to restore all dependencies.
- If you’re using a CI server you want to be able to restore dependencies from command line.
See my previous post about command line tools for restoring dependencies.
I put both tools in the repository’s root folder so they are always available.