how to update moodle version update code example
Example: moodle update cli
cd /var/www/sites/moodle/htdocs/
php /srv/moodle/admin/cli/maintenance.php --enable
git pull
php /srv/moodle/admin/cli/upgrade.php
php /srv/moodle/admin/cli/maintenance.php --disable