moodle install & update with git

$ cd /path/to/your/webroot
$ git clone git://git.moodle.org/moodle.git                       (1)
$ cd moodle
$ git branch -a                                                   (2)
$ git branch --track MOODLE_311_STABLE origin/MOODLE_311_STABLE     (3)
$ git checkout MOODLE_311_STABLE                                   (4)
git status - show wich branch is active?
git pull # download changed/new files. then need db updated from moodle administration


https://docs.moodle.org/311/en/Git_for_Administrators

https://moodle.org/mod/forum/discuss.php?d=210698