Git checkout and submodules?

ajlennon's Avatar


22 Oct, 2014 02:28 PM


I'm running into a problem (hopefully nearly the last with the Mono build).

This appears to be related to use of git submodules. When I build on other platforms, including a Windows Server 2012 on Azure, the build process works correctly and includes registration of git submodules in external\

When I try this under Mono I don't get anything about the submodules, and doing a listing the external\ folder doesn't seem to exist

I'm wondering exactly how the git clone is being done as it seems there might be some kind of difference there?



  1. 1 Posted by ajlennon on 22 Oct, 2014 02:31 PM

    ajlennon's Avatar

    "When I try this under Mono"

    * correction, under Appveyor

  2. 2 Posted by ajlennon on 22 Oct, 2014 03:57 PM

    ajlennon's Avatar

    It looks very much as though the build folder, which I thought was cloned and thus a git repo is actually something more akin to an export. It doesn't seem to have .git ?

  3. Support Staff 3 Posted by Feodor Fitsner on 22 Oct, 2014 04:02 PM

    Feodor Fitsner's Avatar

    Do you have shallow_clone enabled?


  4. 4 Posted by ajlennon on 22 Oct, 2014 04:04 PM

    ajlennon's Avatar

    I did have. I thought that might be the problem and disabled it but I still seem to get the same behaviour

  5. 5 Posted by ajlennon on 22 Oct, 2014 04:55 PM

    ajlennon's Avatar

    I'm now seeing a different behaviour:

    I see the git clone and checkout occur in the log

    git config --global core.autocrlf false
    11git clone -q --branch=master git:// C:\projects\mono-817
    12git checkout -qf abbb03e5acb7b631dbe0aee85c7a1777b90a9d4b

    Unfortunately even though I configure the Windows git client not to convert line endings the repo overrides this and the git checkout is checking out with CRLF endings which then causes issues under cygwin

    Is there a way for me to override the git checkout command to cause it to clone/checkout with the Cygwin git execuable?

    Thanks, Alex

  6. Support Staff 6 Posted by Feodor Fitsner on 22 Oct, 2014 05:33 PM

    Feodor Fitsner's Avatar

    Right now there is no way to override git sequence unless you do some sort of "bootstrap" project with lightweight repo and some build script that clones your main repo during the build.

    I'm just wondering why changing core.autocrlf didn't work for you. Have you tried reading it back immediately after changing? By default git is installed with core.autocrlf input option.

  7. 7 Posted by ajlennon on 22 Oct, 2014 05:43 PM

    ajlennon's Avatar

    I'm not a git expert but I've been reading up a little and the way I understand it works is that you can set your preferred configuration with core.autocrlf but if there is a setting in .gitattributes then this will override what you have set locally

    There are conversion settings in .gitattributes which I believe are setting the files to be checked out appropriately for the platform. The problem then comes when we do the Win32 checkout but then go into Cygwin for the build...

    I'm taking a look now at some options to remove that .gitattributes file from the fetched repo and rechecking out with the line endings correct for Unix..

    Thanks :) Alex

  8. 8 Posted by ajlennon on 23 Oct, 2014 04:30 PM

    ajlennon's Avatar

    For some reason if I change core.autocrlf false (which I was setting to ensure the endings weren't being changed) to core.autocrlf input then all is well.

    I can't quite understand why that should be, but am v. pleased that I now have a Git repo downloading and building :)) Thanks

  9. ajlennon closed this discussion on 23 Oct, 2014 04:30 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac