Version Control in Xamarin Studio RRS feed

  • Question

  • User35208 posted

    A couple of questions for the experts out there:

    1. Does somebody have a .gitignore for Xamarin Studio that they could share?

    2. Are there any documents on how to use git with Xamarin Studio?


    Thursday, February 6, 2014 7:24 PM

All replies

  • User28 posted

    1) This should cover pretty much everything you'd normally want to ignore:

    #Autosave files
    # Build/test output
    # VS sometimes writes these for no apparent reason
    # Per-user data
    # ReSharper
    # dotCover

    2) I'm not aware of any docs on the git support in XS but it's mostly straightforward. If you have questions about how to do specific things you can ask in these forums.

    Thursday, February 6, 2014 9:52 PM
  • User35208 posted


    Thanks for that. I was able to get up and running easily once I created a local repository using GitHub. I'm a bit spoiled by the Git tools in Xcode since it handles the repository creation usually whether you want it to or not!


    Thursday, February 6, 2014 10:14 PM
  • User4383 posted

    Shall I ignore *.designer.cs also? While these files will re-generate and it makes meaningless changes to keep.

    Wednesday, July 8, 2015 2:41 PM
  • User145961 posted

    @Diviner I did ignore .designer.cs file with success.

    And about repositories.config? This one will conflict between Mac and Windows users, is it safe to delete/ignore it from git?

    Thursday, July 30, 2015 2:06 AM
  • User18049 posted

    You do not need the packages/repositories.config file in source control. It will be regenerated when the packages are restored in Xamarin Studio.

    The repositories.config file is used to keep a list of packages.config files that share the same packages directory. This information is used to by NuGet to work out if the files can be removed when uninstalling a NuGet package. NuGet will check the other packages.config files to see if any other project is using that NuGet package before deleting the files. Even if this file is never recreated the only thing that could happen is that when you uninstall a package it gets completely removed even though another project is using it. Then you can fix that by restoring the package for that other project. However Xamarin Studio and Visual Studio should recreate this file if it does not exist.

    Thursday, July 30, 2015 10:52 AM
  • User33747 posted


    Do you have a current .gitignore file ? I've tried a few found on the web - but have had some trouble with packages and and references when I try to collaborate.

    I'll try what you posted + ignore .designer.cs + packages/repositories.config as suggested above

    But if you have something more current - please let me know.


    Wednesday, October 21, 2015 11:04 AM
  • User198819 posted

    I know this is an old thread but I was wondering if someone could post an official / complete .gitignore for us to use. The reason I ask for an official / complete list is that I feel like I am pushing way too much up to Github .... My simple Xamarin forms directory is about 5GB..... I assume that it contains the simulator images and such but I just want source code ONLY REQUIRED to build a working piece of software when opened by either Visual Studio or Xamarin Studio....


    Friday, April 8, 2016 3:11 PM
  • User18049 posted

    @Stephen.1905 - I would guess that you are pushing NuGet packages from your packages directory to GitHub which you do not need to do. However that I do not see the NuGet packages would take up gigabytes of space so there is probably something else.

    There is a gitignore file that is used when creating new projects with Xamarin Studio. Not sure if that will help or not without knowing what is taking up the majority of the space in your directories.

    Saturday, April 9, 2016 9:19 AM
  • User35208 posted

    @Stephen.1905 - here is the .gitignore that I have been using most recently. Can't say that I remember where it came from. Hope it helps.

    #Autosave files
    # globs
    #Mac bundle stuff
    Monday, April 11, 2016 2:07 PM
  • User84705 posted

    This seems to be the .gitignore xamarin is using:


    Monday, April 18, 2016 8:40 AM
  • User125363 posted

    Hi all, just for anyone else doing this, I had created my Git project in GitHub first, then loaded Visual Studio to create the new Xamarin.Forms project, as part of this process, in the bottom-right is a checkbox to create a git project. I selected this, which seemed counter-intuitive (because the git project is already created), but it created the .gitignore that I wanted, then I could successfully commit everything using the Github desktop client without any issue.

    Saturday, February 4, 2017 3:53 PM