Check Moodle Git Repo

Some Moodle servers seem to have a hard time communicating with the repo for Moodle from time to time … CloudFlare ray issues. When one has a script built which is pretty much ‘brain dead’ … e.g. not ‘smart’ and a simple 1-2-3 thing, if Moodle HQ’s git repo can’t be contacted, all of the rest of the script is pretty much useless.

Wanted a way to check to see if the git repo was available. Here’s how:

git ls-remote git://git.moodle.org/moodle.git

Doesn’t have to be executed inside a code directory installed with git.

Side benefit … not only checks access but shows

9ab6e6b20acad01f35134036e55d21ac5d835cd2 refs/tags/v3.5.4

The first column of info is handy for going after a particular branch.