Do backup of code and db dump before doing below.
In the moodle code directory:
git branch --track MOODLE_38_STABLE origin/MOODLE_38_STABLE
then
git checkout MOODLE_38_STABLE
Check which master branch defaulted to:
git branch -a
* should be on 38.
Now when one does git pull, should be upgrading core code.
May as well finish it ... from root of moodle code
php admin/cli/cron.php
php admin/cli/maintenance.php --enable
php admin/cli/upgrade.php --non-interactive
php admin/cli/maintenance.php --disable
php admin/cli/purge_caches.php
Check version:
fgrep '$release' version.php
check ownerships/permissions since you ran above as root?
config.php must be readable by all.
Check with web browser.
'SoS', Ken