Use

sudo -u www-data -g moodlebox git checkout MOODLE_401_STABLE

(I was not aware of the bizarre branch name)

    This is the message that comes up:
    error: Your local changes to the following files would be overwritten by checkout:
    theme/boost/templates/footer.mustache
    Please commit your changes or stash them before you switch branches.
    Aborting

    This message says the file theme/boost/templates/footer.mustache was modified, so the update fails.

    You can try to type

    sudo -u www-data -g moodlebox git stash

    to discard all changes, then retry.

    • Ian replied to this.

      Nicolas
      Thanks - tried it and when I went to moodlebox.home/admin I got this message:
      Invalid permissions detected when trying to create a directory.
      I will copy a new image from backup and try again

        Ian Impossible to say what's the problem, other that it is a consequence of manually modifying the Moodle source code without paying attention to the file permissions.

        On last shot to try to fix the permissions:

        sudo chmod -R ug+w /var/www/moodle
        sudo chown -R www-data.moodlebox /var/www/moodle
        • Ian replied to this.

          Nicolas
          Thanks - it did not work. I am on Moodlebox 4.3 so I will upgrade to 4.4 and try again.

          Ratna Talking of "bizarre branch names"

          Thank you, I was looking for such an explanation.