Version Control in Xamarin Studio

TedRogersTedRogers USMember ✭✭✭✭

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?



  • mhutchmhutch USMember, Xamarin Team Xamurai

    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.

  • TedRogersTedRogers USMember ✭✭✭✭
    edited February 2017


    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!


  • DivinerDiviner HKMember

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

  • GuillaumePerrotGuillaumePerrot USMember ✭✭

    @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?

  • mattwardmattward GBMember Xamurai

    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.

  • Michael,

    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.


  • Stephen.1905Stephen.1905 USMember ✭✭

    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....


  • mattwardmattward GBMember Xamurai

    @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.

  • TedRogersTedRogers USMember ✭✭✭✭

    @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
  • rudgrrudgr NLMember ✭✭
    edited April 2016

    This seems to be the .gitignore xamarin is using:

  • DevologyDevology GBMember ✭✭✭

    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.

Sign In or Register to comment.