There are many that say to run git commands as sudo for web service user. Ubuntu - www-data ... CentOS 6-7 - apache - Debian ? but supposed to be like Ubuntu.
I run as root and the last thing I have my 'up' bash shell script do is set ownerships and reset some permissions ... like completely hiding the hidden .git directory at code root from outside viewers.
Yes, saw the dates .... probably why your server reports mixed ... it is!
Are you going to answer any of my questions? Like ... what do you have now for:
git branch -a
and
fgrep '$release' version.php
Kinda important if I was going to suggest "sideloading" code and replacing .git directory in code to make a correction in usage of git.
From what I've learned ... -b is really for programmers and if one is going to run their own repo of Moodle code.
The official moodle docs I used are located:
https://docs.moodle.org/37/en/Git_for_Administrators
Note that on that page, in the section
Obtaining the code from Git
The git clone command doesn't use -b.
If, however, you wish to pursue your situation ... a little leg work for a via google:
https://stackoverflow.com/questions/36358265/when-does-git-refresh-the-list-of-remote-branches
Not saying info above will provide your answer, however.
Also asked if admin did a full site backup prior to and suggested it might be best to restore what one had prior to attempt.
'SoS', Ken