Git, monogame and cross-platform development

I recently started on a small project. We thought out a small game and are now building it. One of the most important aspects is that it works on Windows, Linux and OSX.

To keep things simple for a bit I decided to start development on Windows and convert the game to Linux later, expecting little problems; trusting the MonoGame framework. I am now in that process of porting but stopped very quickly as I ran into a major issue:

  • Cross platform development using Git (EOL issue)
  • Is it possible to link directories in git?
  • How to handle dependencies in cross platform C++ projects?
  • cross platform git: possible strategies to handle platform specific files
  • Cross platform git hooks
  • What's the best CRLF (carriage return, line feed) handling strategy with Git?
  • You cannot have both a Windows Game and Linux game in the same solution, it won’t run.

    I found out you have to start a new Linux MonoGame project and simply copy and paste the code into it. (Which is a terrible way to manage any project).

    Working with git; I came up with the following

    1. Ignore changes to all .sln files etc, purely keeping the code in the repository in such a way that the base directory is still in the ‘root’ project folder.

    2. Keep all code in submodules and have the ‘root’ project folder branch out into windows, linux, osx branches to keep different editors’ config files.

    The only thing I found with google was about the stuff I just described above. Does anyone have any experience with the issue I described or should I just try something and see if it’s a proper thing to do?

  • How to get GitExtensions installed on Visual Studio 2010 Beta 2?
  • Is there a way to make git auto generate a version number file for a --version option?
  • Git to many remotes
  • Git and Dos - how to exit a command
  • How do you create a bare repo that becomes the source
  • Remove weird 'Iconr' file from the repository
  • One Solution collect form web for “Git, monogame and cross-platform development”

    Essentially you have 2 options. Either use code sharing as described in the Xamarin guidelines here:

    http://docs.xamarin.com/guides/cross-platform/application_fundamentals/building_cross_platform_applications/sharing_code_options/

    Or alternately, there’s a more advanced approach using Portable Class Libraries (although not officially supported yet). I’ve got a description of how that works on my blog.

    http://www.craftworkgames.com/blog/day-6-running-with-monogame-portable/

    Neither solution is ideal but they are both better than copy and pasting code.

    Git Baby is a git and github fan, let's start git clone.