Adding the Git repository after Moodle is installed

Adding the Git repository after Moodle is installed

Paul Archer
Number of replies: 16

Hi 

I installed Moodle by unzipping a downloaded file into a location on my webserver.

I know now that It would have been better if I had installed using git.

However is there any way which I can add a Git repository after Moodle is installed?

Have ssh access to the webserver 

Current version Moodle 4.4.1+ (Build: 20240726)

thanks

PJ

평균 등급 : -
In reply to Paul Archer

Re: Adding the Git repository after Moodle is installed

Ken Task
Particularly helpful Moodlers 사진

See my profile for a link to 'gitify' ... a way to get current code under git versioning.

'SoS', Ken

In reply to Paul Archer

Re: Adding the Git repository after Moodle is installed

Eduardo Kraus
Particularly helpful Moodlers 사진 Plugin developers 사진 Testers 사진

Hi, Paul Archer! 😊

Go to the directory where Moodle is installed and initialize the Git repository

git init

Add the official Moodle Git repository

git remote add origin https://github.com/moodle/moodle/

Select the correct branch, and since you're using version 4.4

git checkout -b MOODLE_404_STABLE

And that's it! 🎉 Now your Moodle installation is under Git control, which will make maintenance and updates much easier in the future.

Eduardo Kraus
Professor / Developer / Passionate about Moodle / Innovation and new products

In reply to Eduardo Kraus

Re: Adding the Git repository after Moodle is installed

Ken Task
Particularly helpful Moodlers 사진

@Eduardo

OP has moodle code already in a directory and doesn't need the git versioning in existing directory.

Might want to share specifics to: "Select the correct branch"

@Paul ... suggest you test the above by copying current code directory to a 'test' directory first.   Then cd into that test directory.

Follow suggestion given ...

In that test directory, try a 'git pull' (which is what you will be doing going after the next point release of the 4.4.x code) and see what happens. 미소

'SoS', Ken

In reply to Ken Task

Re: Adding the Git repository after Moodle is installed

Eduardo Kraus
Particularly helpful Moodlers 사진 Plugin developers 사진 Testers 사진
@Ken
"However is there any way which I can add a Git repository after Moodle is installed?"
In reply to Eduardo Kraus

Re: Adding the Git repository after Moodle is installed

Visvanath Ratnaweera
Particularly helpful Moodlers 사진 Translators 사진

@Eduardo

Not Ken ;), I find this step easy if you think of it as an Upgrade. There under Upgrading#Install_the_new_Moodle_software you are told to:

1. Move your old Moodle software program files to another location. Do NOT copy new files over the old files."

Do just that. Then,

2. Unzip or unpack the upgrade file so that all the new Moodle software program files are in the location the old files used to be in on the server.

Here, instead of unzipping the Moodle code zip file, get the code using Git. For that execute the five commands given in Git_for_Administrators#Obtaining_the_code_from_Git.

Then continue with,

3. Copy your old config.php file back to the new Moodle directory.

etc.

In reply to Ken Task

Re: Adding the Git repository after Moodle is installed

Ken Task
Particularly helpful Moodlers 사진

Correction to above:

"and doesn't need the git versioning in existing directory" .... should be removed!

and there is 'added value' doing it 'another way' ... see the readme for 'gitify'.

https://mg2.sosoftexas.org/scripts/gitify/

one gets an update, an upgrade, and a bu script as 'added value'.

As usual, more than one way! 미소

'SoS', Ken

In reply to Paul Archer

Re: Adding the Git repository after Moodle is installed

Ken Task
Particularly helpful Moodlers 사진

@Paul

Just to be clear ... since this is your first venture into git ... 
it would be wise to run some admin/cli/ scripts prior to which ever method: Mr. V's combo, Eduardo's init, a side load, or my 'gitify' ...

First, backup what you have.  Git is always upwards never 'roll back'.

Second: run from code/admin/cli/ the following: 
* check_database_schema.php
* checks.php
If either of those report issues, fix them.

* uninstall_plugins.php - which has an option to show contributions (add-ons)
Git only does core code and not add-ons.  An incompatible add-on can cause git update or upgrade to fail.   Might add to your config.php file a line to force the theme to one of 2 that come
with core: boost, classic to avoid 3rd party theme incompatibility issues. Just for the update or upgrade - can comment out that line after update/upgrade.

* cron.php - it includes clean ups, etc.

Third: once successful, create 3 scripts ... an update script, which gets point releases, an upgrade script, which takes core code up a major branch - 4.5.0 soon to be released, and a bu (backup script) which backs up code + db dump + minimally moodledata/filedir/

Could also combine the bu into the beginning of the update/upgrade scripts.

Have never regretted taking the time to backup!

Also, whatever method chosen, that will be the last time one has to do the work-around's to get your code under git.   That's why I suggest 3 scripts.

You might also install 'moosh' ... I use it to check plugins I have installed to assure there is a compat version for destination version of core.

'SoS', Ken

In reply to Paul Archer

Re: Adding the Git repository after Moodle is installed

Paul Archer
Thank you all for your advise

Somewhere along the line I have made and error I have created the git repo with a git init etc

and carried out the following

sudo -u www-data git branch --track MOODLE_404_STABLE origin/MOODLE_404_STABLE

sudo -u www-data git checkout MOODLE_404_STABLE

git log --pretty=format:"%h - %ad: %s" --grep="4.4.1"

/var/www/html/moodle $ sudo -u www-data git checkout 04479a6a3c2
HEAD is now at 04479a6a3c2 weekly release 4.4.1+


var/www/html/moodle $ sudo -u www-data git pull

You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

git pull
However I am not sure what action I should take at this point - everything is back up and I am trying this on a 'sandpit' server all be it a copy of production

thanks
In reply to Paul Archer

Re: Adding the Git repository after Moodle is installed

Ken Task
Particularly helpful Moodlers 사진

"have created the git repo with a git init etc"

Am reminded of 'begin with the end in mind'! 미소

So mind sharing the exact commands used for above?

Are you a programmer and plan to develop for Moodle?

If not, you don't need your own git repo (copy) of moodle code.  You just want to use git to update/upgrade your core code.

Good we are doing this in a 'sandpit'! 미소

'SoS', Ken

In reply to Paul Archer

Re: Adding the Git repository after Moodle is installed

Visvanath Ratnaweera
Particularly helpful Moodlers 사진 Translators 사진
Oh, yes. If you take different steps, you will arrive somewhere else. You must decide what you want to do: To take the steps given in https://docs.moodle.org/en/Git_for_Administrators#Obtaining_the_code_from_Git and arrive where everybody else has arrived or take some random steps and enquire where you're.
윙크
In reply to Paul Archer

Re: Adding the Git repository after Moodle is installed

Ken Task
Particularly helpful Moodlers 사진

2 'sense' (nope, spelled it correctly!) more ...

You are using either Debian or Ubuntu.
Evidence: sudo -u www-data in git commands.
Docs say to do that ... I disagree.   I use root user ... no issues with ownerships/permissions then.   Using www-data also means the ownerships/permissions on the hidden .git directory
and hidden .git files allow anyone with a browser to crawl them.
Not good!!!

After I do git as root, I change ownerships/permissions on all moodle code files/directories to web service user then lock down all get .git related folders/files. (part of my 'gitify' added value 'update' and 'upgrade' scripts).

No guest, no group ... root only.

Also .. I wouldn't put moodle code ... production server or not ... at document root of a site ... but in a subdirectory.

Reasons:   Black Hats and Script Kiddies ... and there are tons of them doing 'security research' now a days [yeah, right! 슬픈] ... point their scripts to document root. If one has a static web page there, there is nothing to poke and probe. Reducing the attack surface!

2nd reason ... I can run a production instance and a dev instance in a directory on the same server.

Now back to git:

What do you see if you issue: git branch -a while in code directory?

Maybe I can convince you to try 'gitify'! ;)

'SoS', Ken

In reply to Paul Archer

Re: Adding the Git repository after Moodle is installed

Ken Task
Particularly helpful Moodlers 사진

@Paul ... following the 'git init' suggestion ... the following ... AND the fix not mentioned.

Code directory originally from a tgz download and un-compressed ... no git.

Did:
git init
git remote add origin https://github.com/moodle/moodle/
git checkout -b MOODLE_404_STABLE
which returned:
Switched to a new branch 'MOODLE_404_STABLE'

Checked with git branch -a
Returned nothing.

Missing from directions:
git fetch

Command returns:


remote: Enumerating objects: 1507945, done.
remote: Counting objects: 100% (1257/1257), done.
remote: Compressing objects: 100% (864/864), done.
remote: Total 1507945 (delta 431), reused 1121 (delta 366), pack-reused 1506688 (from 1)
Receiving objects: 100% (1507945/1507945), 769.92 MiB | 41.47 MiB/s, done.
Resolving deltas: 100% (1064402/1064402), done.
From https://github.com/moodle/moodle
 * [new branch]      MOODLE_13_STABLE  -> origin/MOODLE_13_STABLE
 * [new branch]      MOODLE_14_STABLE  -> origin/MOODLE_14_STABLE
 * [new branch]      MOODLE_15_STABLE  -> origin/MOODLE_15_STABLE
 * [new branch]      MOODLE_16_STABLE  -> origin/MOODLE_16_STABLE
 * [new branch]      MOODLE_17_STABLE  -> origin/MOODLE_17_STABLE
 * [new branch]      MOODLE_18_STABLE  -> origin/MOODLE_18_STABLE
 * [new branch]      MOODLE_19_STABLE  -> origin/MOODLE_19_STABLE
 * [new branch]      MOODLE_20_STABLE  -> origin/MOODLE_20_STABLE
 * [new branch]      MOODLE_21_STABLE  -> origin/MOODLE_21_STABLE
 * [new branch]      MOODLE_22_STABLE  -> origin/MOODLE_22_STABLE
 * [new branch]      MOODLE_23_STABLE  -> origin/MOODLE_23_STABLE
 * [new branch]      MOODLE_24_STABLE  -> origin/MOODLE_24_STABLE
 * [new branch]      MOODLE_25_STABLE  -> origin/MOODLE_25_STABLE
 * [new branch]      MOODLE_26_STABLE  -> origin/MOODLE_26_STABLE
 * [new branch]      MOODLE_27_STABLE  -> origin/MOODLE_27_STABLE
 * [new branch]      MOODLE_28_STABLE  -> origin/MOODLE_28_STABLE
 * [new branch]      MOODLE_29_STABLE  -> origin/MOODLE_29_STABLE
 * [new branch]      MOODLE_30_STABLE  -> origin/MOODLE_30_STABLE
 * [new branch]      MOODLE_310_STABLE -> origin/MOODLE_310_STABLE
 * [new branch]      MOODLE_311_STABLE -> origin/MOODLE_311_STABLE
 * [new branch]      MOODLE_31_STABLE  -> origin/MOODLE_31_STABLE
 * [new branch]      MOODLE_32_STABLE  -> origin/MOODLE_32_STABLE
 * [new branch]      MOODLE_33_STABLE  -> origin/MOODLE_33_STABLE
 * [new branch]      MOODLE_34_STABLE  -> origin/MOODLE_34_STABLE
 * [new branch]      MOODLE_35_STABLE  -> origin/MOODLE_35_STABLE
 * [new branch]      MOODLE_36_STABLE  -> origin/MOODLE_36_STABLE
 * [new branch]      MOODLE_37_STABLE  -> origin/MOODLE_37_STABLE
 * [new branch]      MOODLE_38_STABLE  -> origin/MOODLE_38_STABLE
 * [new branch]      MOODLE_39_STABLE  -> origin/MOODLE_39_STABLE
 * [new branch]      MOODLE_400_STABLE -> origin/MOODLE_400_STABLE
 * [new branch]      MOODLE_401_STABLE -> origin/MOODLE_401_STABLE
 * [new branch]      MOODLE_402_STABLE -> origin/MOODLE_402_STABLE
 * [new branch]      MOODLE_403_STABLE -> origin/MOODLE_403_STABLE
 * [new branch]      MOODLE_404_STABLE -> origin/MOODLE_404_STABLE
 * [new branch]      main              -> origin/main
 * [new tag]         v1.3.5            -> v1.3.5
 * [new tag]         v2.0.10           -> v2.0.10
 * [new tag]         v2.1.10           -> v2.1.10
 * [new tag]         v2.2.11           -> v2.2.11
 * [new tag]         v2.3.11           -> v2.3.11
 * [new tag]         v2.4.11           -> v2.4.11
 * [new tag]         v2.5.9            -> v2.5.9
 * [new tag]         v2.7.20           -> v2.7.20
 * [new tag]         v2.8.12           -> v2.8.12
 * [new tag]         v3.0.10           -> v3.0.10
 * [new tag]         v3.1.18           -> v3.1.18
 * [new tag]         v3.10.11          -> v3.10.11
 * [new tag]         v3.11.18          -> v3.11.18
 * [new tag]         v3.2.9            -> v3.2.9
 * [new tag]         v3.4.9            -> v3.4.9
 * [new tag]         v3.5.18           -> v3.5.18
 * [new tag]         v3.6.10           -> v3.6.10
 * [new tag]         v3.7.9            -> v3.7.9
 * [new tag]         v3.8.9            -> v3.8.9
 * [new tag]         v3.9.25           -> v3.9.25
 * [new tag]         v4.0.12           -> v4.0.12
 * [new tag]                 v1.0.0            -> v1.0.0
 * [new tag]                 v1.0.1            -> v1.0.1
 * [new tag]                 v1.0.2            -> v1.0.2
 * [new tag]                 v1.0.3            -> v1.0.3
 * [new tag]                 v1.0.4            -> v1.0.4
 * [new tag]                 v1.0.5            -> v1.0.5
 * [new tag]                 v1.0.6            -> v1.0.6
 * [new tag]                 v1.0.7            -> v1.0.7
 * [new tag]                 v1.0.8            -> v1.0.8
 * [new tag]                 v1.0.9            -> v1.0.9
 * [new tag]                 v1.1.0            -> v1.1.0
 * [new tag]                 v1.1.1            -> v1.1.1
 * [new tag]                 v1.2.0            -> v1.2.0
 * [new tag]                 v1.2.1            -> v1.2.1
 * [new tag]                 v1.3.0            -> v1.3.0
 * [new tag]                 v1.3.1            -> v1.3.1
 * [new tag]                 v1.3.2            -> v1.3.2
 * [new tag]                 v1.3.3            -> v1.3.3
 * [new tag]                 v1.3.4            -> v1.3.4
 * [new tag]                 v1.4.0            -> v1.4.0
 * [new tag]                 v1.4.1            -> v1.4.1
 * [new tag]                 v1.4.2            -> v1.4.2
 * [new tag]                 v1.4.3            -> v1.4.3
 * [new tag]                 v1.4.4            -> v1.4.4
 * [new tag]                 v1.4.5            -> v1.4.5
 * [new tag]                 v1.5.0            -> v1.5.0
 * [new tag]                 v1.5.1            -> v1.5.1
 * [new tag]                 v1.5.2            -> v1.5.2
 * [new tag]                 v1.5.3            -> v1.5.3
 * [new tag]                 v1.5.4            -> v1.5.4
 * [new tag]                 v1.6.0            -> v1.6.0
 * [new tag]                 v1.6.1            -> v1.6.1
 * [new tag]                 v1.6.2            -> v1.6.2
 * [new tag]                 v1.6.3            -> v1.6.3
 * [new tag]                 v1.6.4            -> v1.6.4
 * [new tag]                 v1.6.5            -> v1.6.5
 * [new tag]                 v1.6.6            -> v1.6.6
 * [new tag]                 v1.6.7            -> v1.6.7
 * [new tag]                 v1.6.8            -> v1.6.8
 * [new tag]                 v1.6.9            -> v1.6.9
 * [new tag]                 v1.7.0            -> v1.7.0
 * [new tag]                 v1.7.1            -> v1.7.1
 * [new tag]                 v1.7.2            -> v1.7.2
 * [new tag]                 v1.7.3            -> v1.7.3
 * [new tag]                 v1.7.4            -> v1.7.4
 * [new tag]                 v1.7.5            -> v1.7.5
 * [new tag]                 v1.7.6            -> v1.7.6
 * [new tag]                 v1.7.7            -> v1.7.7
 * [new tag]                 v1.8.0            -> v1.8.0
 * [new tag]                 v1.8.1            -> v1.8.1
 * [new tag]                 v1.8.10           -> v1.8.10
 * [new tag]                 v1.8.11           -> v1.8.11
 * [new tag]                 v1.8.12           -> v1.8.12
 * [new tag]                 v1.8.13           -> v1.8.13
 * [new tag]                 v1.8.14           -> v1.8.14
 * [new tag]                 v1.8.2            -> v1.8.2
 * [new tag]                 v1.8.3            -> v1.8.3
 * [new tag]                 v1.8.4            -> v1.8.4
 * [new tag]                 v1.8.5            -> v1.8.5
 * [new tag]                 v1.8.6            -> v1.8.6
 * [new tag]                 v1.8.7            -> v1.8.7
 * [new tag]                 v1.8.8            -> v1.8.8
 * [new tag]                 v1.8.9            -> v1.8.9
 * [new tag]                 v1.9.0            -> v1.9.0
 * [new tag]                 v1.9.1            -> v1.9.1
 * [new tag]                 v1.9.10           -> v1.9.10
 * [new tag]                 v1.9.11           -> v1.9.11
 * [new tag]                 v1.9.12           -> v1.9.12
 * [new tag]                 v1.9.13           -> v1.9.13
 * [new tag]                 v1.9.14           -> v1.9.14
 * [new tag]                 v1.9.15           -> v1.9.15
 * [new tag]                 v1.9.16           -> v1.9.16
 * [new tag]                 v1.9.17           -> v1.9.17
 * [new tag]                 v1.9.18           -> v1.9.18
 * [new tag]                 v1.9.19           -> v1.9.19
 * [new tag]                 v1.9.2            -> v1.9.2
 * [new tag]                 v1.9.3            -> v1.9.3
 * [new tag]                 v1.9.4            -> v1.9.4
 * [new tag]                 v1.9.5            -> v1.9.5
 * [new tag]                 v1.9.6            -> v1.9.6
 * [new tag]                 v1.9.7            -> v1.9.7
 * [new tag]                 v1.9.8            -> v1.9.8
 * [new tag]                 v1.9.9            -> v1.9.9
 * [new tag]                 v2.0.0            -> v2.0.0
 * [new tag]                 v2.0.0-rc1        -> v2.0.0-rc1
 * [new tag]                 v2.0.0-rc2        -> v2.0.0-rc2
 * [new tag]                 v2.0.1            -> v2.0.1
 * [new tag]                 v2.0.2            -> v2.0.2
 * [new tag]                 v2.0.3            -> v2.0.3
 * [new tag]                 v2.0.4            -> v2.0.4
 * [new tag]                 v2.0.5            -> v2.0.5
 * [new tag]                 v2.0.6            -> v2.0.6
 * [new tag]                 v2.0.7            -> v2.0.7
 * [new tag]                 v2.0.8            -> v2.0.8
 * [new tag]                 v2.0.9            -> v2.0.9
 * [new tag]                 v2.1.0            -> v2.1.0
 * [new tag]                 v2.1.1            -> v2.1.1
 * [new tag]                 v2.1.2            -> v2.1.2
 * [new tag]                 v2.1.3            -> v2.1.3
 * [new tag]                 v2.1.4            -> v2.1.4
 * [new tag]                 v2.1.5            -> v2.1.5
 * [new tag]                 v2.1.6            -> v2.1.6
 * [new tag]                 v2.1.7            -> v2.1.7
 * [new tag]                 v2.1.8            -> v2.1.8
 * [new tag]                 v2.1.9            -> v2.1.9
 * [new tag]                 v2.2.0            -> v2.2.0
 * [new tag]                 v2.2.0-beta       -> v2.2.0-beta
 * [new tag]                 v2.2.0-rc1        -> v2.2.0-rc1
 * [new tag]                 v2.2.1            -> v2.2.1
 * [new tag]                 v2.2.10           -> v2.2.10
 * [new tag]                 v2.2.2            -> v2.2.2
 * [new tag]                 v2.2.3            -> v2.2.3
 * [new tag]                 v2.2.4            -> v2.2.4
 * [new tag]                 v2.2.5            -> v2.2.5
 * [new tag]                 v2.2.6            -> v2.2.6
 * [new tag]                 v2.2.7            -> v2.2.7
 * [new tag]                 v2.2.8            -> v2.2.8
 * [new tag]                 v2.2.9            -> v2.2.9
 * [new tag]                 v2.3.0            -> v2.3.0
 * [new tag]                 v2.3.0-beta       -> v2.3.0-beta
 * [new tag]                 v2.3.0-rc1        -> v2.3.0-rc1
 * [new tag]                 v2.3.1            -> v2.3.1
 * [new tag]                 v2.3.10           -> v2.3.10
 * [new tag]                 v2.3.2            -> v2.3.2
 * [new tag]                 v2.3.3            -> v2.3.3
 * [new tag]                 v2.3.4            -> v2.3.4
 * [new tag]                 v2.3.5            -> v2.3.5
 * [new tag]                 v2.3.6            -> v2.3.6
 * [new tag]                 v2.3.7            -> v2.3.7
 * [new tag]                 v2.3.8            -> v2.3.8
 * [new tag]                 v2.3.9            -> v2.3.9
 * [new tag]                 v2.4.0            -> v2.4.0
 * [new tag]                 v2.4.0-beta       -> v2.4.0-beta
 * [new tag]                 v2.4.0-rc1        -> v2.4.0-rc1
 * [new tag]                 v2.4.1            -> v2.4.1
 * [new tag]                 v2.4.10           -> v2.4.10
 * [new tag]                 v2.4.2            -> v2.4.2
 * [new tag]                 v2.4.3            -> v2.4.3
 * [new tag]                 v2.4.4            -> v2.4.4
 * [new tag]                 v2.4.5            -> v2.4.5
 * [new tag]                 v2.4.6            -> v2.4.6
 * [new tag]                 v2.4.7            -> v2.4.7
 * [new tag]                 v2.4.8            -> v2.4.8
 * [new tag]                 v2.4.9            -> v2.4.9
 * [new tag]                 v2.5.0            -> v2.5.0
 * [new tag]                 v2.5.0-beta       -> v2.5.0-beta
 * [new tag]                 v2.5.0-rc1        -> v2.5.0-rc1
 * [new tag]                 v2.5.1            -> v2.5.1
 * [new tag]                 v2.5.2            -> v2.5.2
 * [new tag]                 v2.5.3            -> v2.5.3
 * [new tag]                 v2.5.4            -> v2.5.4
 * [new tag]                 v2.5.5            -> v2.5.5
 * [new tag]                 v2.5.6            -> v2.5.6
 * [new tag]                 v2.5.7            -> v2.5.7
 * [new tag]                 v2.5.8            -> v2.5.8
 * [new tag]                 v2.6.0            -> v2.6.0
 * [new tag]                 v2.6.0-beta       -> v2.6.0-beta
 * [new tag]                 v2.6.0-rc1        -> v2.6.0-rc1
 * [new tag]                 v2.6.1            -> v2.6.1
 * [new tag]                 v2.6.10           -> v2.6.10
 * [new tag]                 v2.6.11           -> v2.6.11
 * [new tag]                 v2.6.2            -> v2.6.2
 * [new tag]                 v2.6.3            -> v2.6.3
 * [new tag]                 v2.6.4            -> v2.6.4
 * [new tag]                 v2.6.5            -> v2.6.5
 * [new tag]                 v2.6.6            -> v2.6.6
 * [new tag]                 v2.6.7            -> v2.6.7
 * [new tag]                 v2.6.8            -> v2.6.8
 * [new tag]                 v2.6.9            -> v2.6.9
 * [new tag]                 v2.7.0            -> v2.7.0
 * [new tag]                 v2.7.0-beta       -> v2.7.0-beta
 * [new tag]                 v2.7.0-rc1        -> v2.7.0-rc1
 * [new tag]                 v2.7.0-rc2        -> v2.7.0-rc2
 * [new tag]                 v2.7.1            -> v2.7.1
 * [new tag]                 v2.7.10           -> v2.7.10
 * [new tag]                 v2.7.11           -> v2.7.11
 * [new tag]                 v2.7.12           -> v2.7.12
 * [new tag]                 v2.7.13           -> v2.7.13
 * [new tag]                 v2.7.14           -> v2.7.14
 * [new tag]                 v2.7.15           -> v2.7.15
 * [new tag]                 v2.7.16           -> v2.7.16
 * [new tag]                 v2.7.17           -> v2.7.17
 * [new tag]                 v2.7.18           -> v2.7.18
 * [new tag]                 v2.7.19           -> v2.7.19
 * [new tag]                 v2.7.2            -> v2.7.2
 * [new tag]                 v2.7.3            -> v2.7.3
 * [new tag]                 v2.7.4            -> v2.7.4
 * [new tag]                 v2.7.5            -> v2.7.5
 * [new tag]                 v2.7.6            -> v2.7.6
 * [new tag]                 v2.7.7            -> v2.7.7
 * [new tag]                 v2.7.8            -> v2.7.8
 * [new tag]                 v2.7.9            -> v2.7.9
 * [new tag]                 v2.8.0            -> v2.8.0
 * [new tag]                 v2.8.0-beta       -> v2.8.0-beta
 * [new tag]                 v2.8.0-rc1        -> v2.8.0-rc1
 * [new tag]                 v2.8.0-rc2        -> v2.8.0-rc2
 * [new tag]                 v2.8.1            -> v2.8.1
 * [new tag]                 v2.8.10           -> v2.8.10
 * [new tag]                 v2.8.11           -> v2.8.11
 * [new tag]                 v2.8.2            -> v2.8.2
 * [new tag]                 v2.8.3            -> v2.8.3
 * [new tag]                 v2.8.4            -> v2.8.4
 * [new tag]                 v2.8.5            -> v2.8.5
 * [new tag]                 v2.8.6            -> v2.8.6
 * [new tag]                 v2.8.7            -> v2.8.7
 * [new tag]                 v2.8.8            -> v2.8.8
 * [new tag]                 v2.8.9            -> v2.8.9
 * [new tag]                 v2.9.0            -> v2.9.0
 * [new tag]                 v2.9.0-beta       -> v2.9.0-beta
 * [new tag]                 v2.9.0-rc1        -> v2.9.0-rc1
 * [new tag]                 v2.9.0-rc2        -> v2.9.0-rc2
 * [new tag]                 v2.9.1            -> v2.9.1
 * [new tag]                 v2.9.2            -> v2.9.2
 * [new tag]                 v2.9.3            -> v2.9.3
 * [new tag]                 v2.9.4            -> v2.9.4
 * [new tag]                 v2.9.5            -> v2.9.5
 * [new tag]                 v2.9.6            -> v2.9.6
 * [new tag]                 v2.9.7            -> v2.9.7
 * [new tag]                 v2.9.8            -> v2.9.8
 * [new tag]                 v2.9.9            -> v2.9.9
 * [new tag]                 v3.0.0            -> v3.0.0
 * [new tag]                 v3.0.0-beta       -> v3.0.0-beta
 * [new tag]                 v3.0.0-rc1        -> v3.0.0-rc1
 * [new tag]                 v3.0.0-rc2        -> v3.0.0-rc2
 * [new tag]                 v3.0.0-rc3        -> v3.0.0-rc3
 * [new tag]                 v3.0.0-rc4        -> v3.0.0-rc4
 * [new tag]                 v3.0.1            -> v3.0.1
 * [new tag]                 v3.0.2            -> v3.0.2
 * [new tag]                 v3.0.3            -> v3.0.3
 * [new tag]                 v3.0.4            -> v3.0.4
 * [new tag]                 v3.0.5            -> v3.0.5
 * [new tag]                 v3.0.6            -> v3.0.6
 * [new tag]                 v3.0.7            -> v3.0.7
 * [new tag]                 v3.0.8            -> v3.0.8
 * [new tag]                 v3.0.9            -> v3.0.9
 * [new tag]                 v3.1.0            -> v3.1.0
 * [new tag]                 v3.1.0-beta       -> v3.1.0-beta
 * [new tag]                 v3.1.0-rc1        -> v3.1.0-rc1
 * [new tag]                 v3.1.0-rc2        -> v3.1.0-rc2
 * [new tag]                 v3.1.1            -> v3.1.1
 * [new tag]                 v3.1.10           -> v3.1.10
 * [new tag]                 v3.1.11           -> v3.1.11
 * [new tag]                 v3.1.12           -> v3.1.12
 * [new tag]                 v3.1.13           -> v3.1.13
 * [new tag]                 v3.1.14           -> v3.1.14
 * [new tag]                 v3.1.15           -> v3.1.15
 * [new tag]                 v3.1.16           -> v3.1.16
 * [new tag]                 v3.1.17           -> v3.1.17
 * [new tag]                 v3.1.2            -> v3.1.2
 * [new tag]                 v3.1.3            -> v3.1.3
 * [new tag]                 v3.1.4            -> v3.1.4
 * [new tag]                 v3.1.5            -> v3.1.5
 * [new tag]                 v3.1.6            -> v3.1.6
 * [new tag]                 v3.1.7            -> v3.1.7
 * [new tag]                 v3.1.8            -> v3.1.8
 * [new tag]                 v3.1.9            -> v3.1.9
 * [new tag]                 v3.10.0           -> v3.10.0
 * [new tag]                 v3.10.0-beta      -> v3.10.0-beta
 * [new tag]                 v3.10.0-rc1       -> v3.10.0-rc1
 * [new tag]                 v3.10.0-rc2       -> v3.10.0-rc2
 * [new tag]                 v3.10.1           -> v3.10.1
 * [new tag]                 v3.10.10          -> v3.10.10
 * [new tag]                 v3.10.2           -> v3.10.2
 * [new tag]                 v3.10.3           -> v3.10.3
 * [new tag]                 v3.10.4           -> v3.10.4
 * [new tag]                 v3.10.5           -> v3.10.5
 * [new tag]                 v3.10.6           -> v3.10.6
 * [new tag]                 v3.10.7           -> v3.10.7
 * [new tag]                 v3.10.8           -> v3.10.8
 * [new tag]                 v3.10.9           -> v3.10.9
 * [new tag]                 v3.11.0           -> v3.11.0
 * [new tag]                 v3.11.0-beta      -> v3.11.0-beta
 * [new tag]                 v3.11.0-rc1       -> v3.11.0-rc1
 * [new tag]                 v3.11.0-rc2       -> v3.11.0-rc2
 * [new tag]                 v3.11.1           -> v3.11.1
 * [new tag]                 v3.11.10          -> v3.11.10
 * [new tag]                 v3.11.11          -> v3.11.11
 * [new tag]                 v3.11.12          -> v3.11.12
 * [new tag]                 v3.11.13          -> v3.11.13
 * [new tag]                 v3.11.14          -> v3.11.14
 * [new tag]                 v3.11.15          -> v3.11.15
 * [new tag]                 v3.11.16          -> v3.11.16
 * [new tag]                 v3.11.17          -> v3.11.17
 * [new tag]                 v3.11.2           -> v3.11.2
 * [new tag]                 v3.11.3           -> v3.11.3
 * [new tag]                 v3.11.4           -> v3.11.4
 * [new tag]                 v3.11.5           -> v3.11.5
 * [new tag]                 v3.11.6           -> v3.11.6
 * [new tag]                 v3.11.7           -> v3.11.7
 * [new tag]                 v3.11.8           -> v3.11.8
 * [new tag]                 v3.11.9           -> v3.11.9
 * [new tag]                 v3.2.0            -> v3.2.0
 * [new tag]                 v3.2.0-beta       -> v3.2.0-beta
 * [new tag]                 v3.2.0-rc1        -> v3.2.0-rc1
 * [new tag]                 v3.2.0-rc2        -> v3.2.0-rc2
 * [new tag]                 v3.2.0-rc3        -> v3.2.0-rc3
 * [new tag]                 v3.2.0-rc4        -> v3.2.0-rc4
 * [new tag]                 v3.2.0-rc5        -> v3.2.0-rc5
 * [new tag]                 v3.2.1            -> v3.2.1
 * [new tag]                 v3.2.2            -> v3.2.2
 * [new tag]                 v3.2.3            -> v3.2.3
 * [new tag]                 v3.2.4            -> v3.2.4
 * [new tag]                 v3.2.5            -> v3.2.5
 * [new tag]                 v3.2.6            -> v3.2.6
 * [new tag]                 v3.2.7            -> v3.2.7
 * [new tag]                 v3.2.8            -> v3.2.8
 * [new tag]                 v3.3.0            -> v3.3.0
 * [new tag]                 v3.3.0-beta       -> v3.3.0-beta
 * [new tag]                 v3.3.0-rc1        -> v3.3.0-rc1
 * [new tag]                 v3.3.0-rc2        -> v3.3.0-rc2
 * [new tag]                 v3.3.0-rc3        -> v3.3.0-rc3
 * [new tag]                 v3.3.1            -> v3.3.1
 * [new tag]                 v3.3.2            -> v3.3.2
 * [new tag]                 v3.3.3            -> v3.3.3
 * [new tag]                 v3.3.4            -> v3.3.4
 * [new tag]                 v3.3.5            -> v3.3.5
 * [new tag]                 v3.3.6            -> v3.3.6
 * [new tag]                 v3.3.7            -> v3.3.7
 * [new tag]                 v3.3.8            -> v3.3.8
 * [new tag]                 v3.3.9            -> v3.3.9
 * [new tag]                 v3.4.0            -> v3.4.0
 * [new tag]                 v3.4.0-beta       -> v3.4.0-beta
 * [new tag]                 v3.4.0-rc1        -> v3.4.0-rc1
 * [new tag]                 v3.4.0-rc2        -> v3.4.0-rc2
 * [new tag]                 v3.4.0-rc3        -> v3.4.0-rc3
 * [new tag]                 v3.4.1            -> v3.4.1
 * [new tag]                 v3.4.2            -> v3.4.2
 * [new tag]                 v3.4.3            -> v3.4.3
 * [new tag]                 v3.4.4            -> v3.4.4
 * [new tag]                 v3.4.5            -> v3.4.5
 * [new tag]                 v3.4.6            -> v3.4.6
 * [new tag]                 v3.4.7            -> v3.4.7
 * [new tag]                 v3.4.8            -> v3.4.8
 * [new tag]                 v3.5.0            -> v3.5.0
 * [new tag]                 v3.5.0-beta       -> v3.5.0-beta
 * [new tag]                 v3.5.0-rc1        -> v3.5.0-rc1
 * [new tag]                 v3.5.1            -> v3.5.1
 * [new tag]                 v3.5.10           -> v3.5.10
 * [new tag]                 v3.5.11           -> v3.5.11
 * [new tag]                 v3.5.12           -> v3.5.12
 * [new tag]                 v3.5.13           -> v3.5.13
 * [new tag]                 v3.5.14           -> v3.5.14
 * [new tag]                 v3.5.15           -> v3.5.15
 * [new tag]                 v3.5.16           -> v3.5.16
 * [new tag]                 v3.5.17           -> v3.5.17
 * [new tag]                 v3.5.2            -> v3.5.2
 * [new tag]                 v3.5.3            -> v3.5.3
 * [new tag]                 v3.5.4            -> v3.5.4
 * [new tag]                 v3.5.5            -> v3.5.5
 * [new tag]                 v3.5.6            -> v3.5.6
 * [new tag]                 v3.5.7            -> v3.5.7
 * [new tag]                 v3.5.8            -> v3.5.8
 * [new tag]                 v3.5.9            -> v3.5.9
 * [new tag]                 v3.6.0            -> v3.6.0
 * [new tag]                 v3.6.0-beta       -> v3.6.0-beta
 * [new tag]                 v3.6.0-rc1        -> v3.6.0-rc1
 * [new tag]                 v3.6.0-rc2        -> v3.6.0-rc2
 * [new tag]                 v3.6.0-rc3        -> v3.6.0-rc3
 * [new tag]                 v3.6.1            -> v3.6.1
 * [new tag]                 v3.6.2            -> v3.6.2
 * [new tag]                 v3.6.3            -> v3.6.3
 * [new tag]                 v3.6.4            -> v3.6.4
 * [new tag]                 v3.6.5            -> v3.6.5
 * [new tag]                 v3.6.6            -> v3.6.6
 * [new tag]                 v3.6.7            -> v3.6.7
 * [new tag]                 v3.6.8            -> v3.6.8
 * [new tag]                 v3.6.9            -> v3.6.9
 * [new tag]                 v3.7.0            -> v3.7.0
 * [new tag]                 v3.7.0-beta       -> v3.7.0-beta
 * [new tag]                 v3.7.0-rc1        -> v3.7.0-rc1
 * [new tag]                 v3.7.0-rc2        -> v3.7.0-rc2
 * [new tag]                 v3.7.1            -> v3.7.1
 * [new tag]                 v3.7.2            -> v3.7.2
 * [new tag]                 v3.7.3            -> v3.7.3
 * [new tag]                 v3.7.4            -> v3.7.4
 * [new tag]                 v3.7.5            -> v3.7.5
 * [new tag]                 v3.7.6            -> v3.7.6
 * [new tag]                 v3.7.7            -> v3.7.7
 * [new tag]                 v3.7.8            -> v3.7.8
 * [new tag]                 v3.8.0            -> v3.8.0
 * [new tag]                 v3.8.0-beta       -> v3.8.0-beta
 * [new tag]                 v3.8.0-rc1        -> v3.8.0-rc1
 * [new tag]                 v3.8.1            -> v3.8.1
 * [new tag]                 v3.8.2            -> v3.8.2
 * [new tag]                 v3.8.3            -> v3.8.3
 * [new tag]                 v3.8.4            -> v3.8.4
 * [new tag]                 v3.8.5            -> v3.8.5
 * [new tag]                 v3.8.6            -> v3.8.6
 * [new tag]                 v3.8.7            -> v3.8.7
 * [new tag]                 v3.8.8            -> v3.8.8
 * [new tag]                 v3.9.0            -> v3.9.0
 * [new tag]                 v3.9.0-beta       -> v3.9.0-beta
 * [new tag]                 v3.9.0-rc1        -> v3.9.0-rc1
 * [new tag]                 v3.9.0-rc2        -> v3.9.0-rc2
 * [new tag]                 v3.9.0-rc3        -> v3.9.0-rc3
 * [new tag]                 v3.9.1            -> v3.9.1
 * [new tag]                 v3.9.10           -> v3.9.10
 * [new tag]                 v3.9.11           -> v3.9.11
 * [new tag]                 v3.9.12           -> v3.9.12
 * [new tag]                 v3.9.13           -> v3.9.13
 * [new tag]                 v3.9.14           -> v3.9.14
 * [new tag]                 v3.9.15           -> v3.9.15
 * [new tag]                 v3.9.16           -> v3.9.16
 * [new tag]                 v3.9.17           -> v3.9.17
 * [new tag]                 v3.9.18           -> v3.9.18
 * [new tag]                 v3.9.19           -> v3.9.19
 * [new tag]                 v3.9.2            -> v3.9.2
 * [new tag]                 v3.9.20           -> v3.9.20
 * [new tag]                 v3.9.21           -> v3.9.21
 * [new tag]                 v3.9.22           -> v3.9.22
 * [new tag]                 v3.9.23           -> v3.9.23
 * [new tag]                 v3.9.24           -> v3.9.24
 * [new tag]                 v3.9.3            -> v3.9.3
 * [new tag]                 v3.9.4            -> v3.9.4
 * [new tag]                 v3.9.5            -> v3.9.5
 * [new tag]                 v3.9.6            -> v3.9.6
 * [new tag]                 v3.9.7            -> v3.9.7
 * [new tag]                 v3.9.8            -> v3.9.8
 * [new tag]                 v3.9.9            -> v3.9.9
 * [new tag]                 v4.0.0            -> v4.0.0
 * [new tag]                 v4.0.0-beta       -> v4.0.0-beta
 * [new tag]                 v4.0.0-rc1        -> v4.0.0-rc1
 * [new tag]                 v4.0.0-rc2        -> v4.0.0-rc2
 * [new tag]                 v4.0.0-rc3        -> v4.0.0-rc3
 * [new tag]                 v4.0.0-rc4        -> v4.0.0-rc4
 * [new tag]                 v4.0.1            -> v4.0.1
 * [new tag]                 v4.0.10           -> v4.0.10
 * [new tag]                 v4.0.11           -> v4.0.11
 * [new tag]                 v4.0.2            -> v4.0.2
 * [new tag]                 v4.0.3            -> v4.0.3
 * [new tag]                 v4.0.4            -> v4.0.4
 * [new tag]                 v4.0.5            -> v4.0.5
 * [new tag]                 v4.0.6            -> v4.0.6
 * [new tag]                 v4.0.7            -> v4.0.7
 * [new tag]                 v4.0.8            -> v4.0.8
 * [new tag]                 v4.0.9            -> v4.0.9
 * [new tag]                 v4.1.0            -> v4.1.0
 * [new tag]                 v4.1.0-beta       -> v4.1.0-beta
 * [new tag]                 v4.1.0-rc1        -> v4.1.0-rc1
 * [new tag]                 v4.1.0-rc2        -> v4.1.0-rc2
 * [new tag]                 v4.1.0-rc3        -> v4.1.0-rc3
 * [new tag]                 v4.1.1            -> v4.1.1
 * [new tag]                 v4.1.10           -> v4.1.10
 * [new tag]                 v4.1.11           -> v4.1.11
 * [new tag]                 v4.1.12           -> v4.1.12
 * [new tag]                 v4.1.13           -> v4.1.13
 * [new tag]                 v4.1.2            -> v4.1.2
 * [new tag]                 v4.1.3            -> v4.1.3
 * [new tag]                 v4.1.4            -> v4.1.4
 * [new tag]                 v4.1.5            -> v4.1.5
 * [new tag]                 v4.1.6            -> v4.1.6
 * [new tag]                 v4.1.7            -> v4.1.7
 * [new tag]                 v4.1.8            -> v4.1.8
 * [new tag]                 v4.1.9            -> v4.1.9
 * [new tag]                 v4.2.0            -> v4.2.0
 * [new tag]                 v4.2.0-beta       -> v4.2.0-beta
 * [new tag]                 v4.2.0-rc1        -> v4.2.0-rc1
 * [new tag]                 v4.2.0-rc2        -> v4.2.0-rc2
 * [new tag]                 v4.2.1            -> v4.2.1
 * [new tag]                 v4.2.10           -> v4.2.10
 * [new tag]                 v4.2.2            -> v4.2.2
 * [new tag]                 v4.2.3            -> v4.2.3
 * [new tag]                 v4.2.4            -> v4.2.4
 * [new tag]                 v4.2.5            -> v4.2.5
 * [new tag]                 v4.2.6            -> v4.2.6
 * [new tag]                 v4.2.7            -> v4.2.7
 * [new tag]                 v4.2.8            -> v4.2.8
 * [new tag]                 v4.2.9            -> v4.2.9
 * [new tag]                 v4.3.0            -> v4.3.0
 * [new tag]                 v4.3.0-beta       -> v4.3.0-beta
 * [new tag]                 v4.3.0-rc1        -> v4.3.0-rc1
 * [new tag]                 v4.3.0-rc2        -> v4.3.0-rc2
 * [new tag]                 v4.3.1            -> v4.3.1
 * [new tag]                 v4.3.2            -> v4.3.2
 * [new tag]                 v4.3.3            -> v4.3.3
 * [new tag]                 v4.3.4            -> v4.3.4
 * [new tag]                 v4.3.5            -> v4.3.5
 * [new tag]                 v4.3.6            -> v4.3.6
 * [new tag]                 v4.3.7            -> v4.3.7
 * [new tag]                 v4.4.0            -> v4.4.0
 * [new tag]                 v4.4.0-beta       -> v4.4.0-beta
 * [new tag]                 v4.4.0-rc1        -> v4.4.0-rc1
 * [new tag]                 v4.4.0-rc2        -> v4.4.0-rc2
 * [new tag]                 v4.4.1            -> v4.4.1
 * [new tag]                 v4.4.2            -> v4.4.2
 * [new tag]                 v4.4.3            -> v4.4.3

Now when I issue:
git branch -a
I see the branches.
  remotes/origin/MOODLE_13_STABLE
  remotes/origin/MOODLE_14_STABLE
  remotes/origin/MOODLE_15_STABLE
  remotes/origin/MOODLE_16_STABLE
  remotes/origin/MOODLE_17_STABLE
  remotes/origin/MOODLE_18_STABLE
  remotes/origin/MOODLE_19_STABLE
  remotes/origin/MOODLE_20_STABLE
  remotes/origin/MOODLE_21_STABLE
  remotes/origin/MOODLE_22_STABLE
  remotes/origin/MOODLE_23_STABLE
  remotes/origin/MOODLE_24_STABLE
  remotes/origin/MOODLE_25_STABLE
  remotes/origin/MOODLE_26_STABLE
  remotes/origin/MOODLE_27_STABLE
  remotes/origin/MOODLE_28_STABLE
  remotes/origin/MOODLE_29_STABLE
  remotes/origin/MOODLE_30_STABLE
  remotes/origin/MOODLE_310_STABLE
  remotes/origin/MOODLE_311_STABLE
  remotes/origin/MOODLE_31_STABLE
  remotes/origin/MOODLE_32_STABLE
  remotes/origin/MOODLE_33_STABLE
  remotes/origin/MOODLE_34_STABLE
  remotes/origin/MOODLE_35_STABLE
  remotes/origin/MOODLE_36_STABLE
  remotes/origin/MOODLE_37_STABLE
  remotes/origin/MOODLE_38_STABLE
  remotes/origin/MOODLE_39_STABLE
  remotes/origin/MOODLE_400_STABLE
  remotes/origin/MOODLE_401_STABLE
  remotes/origin/MOODLE_402_STABLE
  remotes/origin/MOODLE_403_STABLE
  remotes/origin/MOODLE_404_STABLE
  remotes/origin/main

But ... now I can re-issue:

git checkout -b MOODLE_404_STABLE
Switched to a new branch 'MOODLE_404_STABLE'

git checkout MOODLE_404_STABLE

But:

error: The following untracked working tree files would be overwritten by checkout:
    .eslintrc
    .gherkin-lintrc
    .gitattributes
    .github/FUNDING.yml
    .github/PULL_REQUEST_TEMPLATE.txt
    .github/SECURITY.md
    .github/moodlelogo.svg
    .github/workflows/close-pull-requests.yml
    .github/workflows/config-template.php
    .github/workflows/onebyone.yml
    .github/workflows/push.yml
    .github/workflows/web-installer-test.yml
    .github/workflows/windows.yml
    .grunt/babel-plugin-add-module-to-define.js
    .grunt/components.js
    .grunt/jsdoc/README.md
    .grunt/jsdoc/jsdoc.conf.js
    .grunt/tasks/componentlibrary.js
    .grunt/tasks/eslint.js
    .grunt/tasks/gherkinlint.js
    .grunt/tasks/ignorefiles.js
    .grunt/tasks/javascript.js
    .grunt/tasks/jsconfig.js
    .grunt/tasks/jsdoc.js
    .grunt/tasks/sass.js
    .grunt/tasks/shifter.js
    .grunt/tasks/startup.js
    .grunt/tasks/style.js
    .grunt/tasks/stylelint.js
    .grunt/tasks/upgradablelibs.js
    .grunt/tasks/watch.js
    .jshintignore
    .jshintrc
    .nvmrc
    .phpstorm.meta.php/di.php
    .shifter.json
    .stylelintrc
    CONTRIBUTING.md
    COPYING.txt
    Gruntfile.js
    INSTALL.txt
    README.md
    TRADEMARK.txt
    admin/amd/build/block_management_table.min.js
    admin/amd/build/block_management_table.min.js.map
    admin/amd/build/bulk_user_actions.min.js
    admin/amd/build/bulk_user_actions.min.js.map
    admin/amd/build/plugin_management_table.min.js
    admin/amd/build/plugin_management_table.min.js.map
    admin/amd/build/themeselector/preview_modal.min.js
    admin/amd/build/themeselector/preview_modal.min.js.map
    admin/amd/src/block_management_table.js
    admin/amd/src/bulk_user_actions.js
    admin/amd/src/plugin_management_table.js
    admin/amd/src/themeselector/preview_modal.js
    admin/antiviruses.php
    admin/auth.php
    admin/blocks.php
    admin/category.php
    admin/classes/admin/admin_setting_plugin_manager.php
    admin/classes/external/set_block_protection.php
    admin/classes/external/set_plugin_order.php
    admin/classes/external/set_plugin_state.php
    admin/classes/form/purge_caches.php
    admin/classes/form/testoutgoingmailconf_form.php
    admin/classes/local/externalpage/accesscallback.php
    admin/classes/local/settings/autocomplete.php
    admin/classes/local/settings/filesize.php
    admin/classes/local/settings/linkable_settings_page.php
    admin/classes/local/settings/manage_payment_gateway_plugins.php
    admin/classes/local/settings/setting_scheduled_task_status.php
    admin/classes/output/theme_selector.php
    admin/classes/privacy/provider.php
    admin/classes/reportbuilder/datasource/task_logs.php
    admin/classes/reportbuilder/local/entities/task_log.php
    admin/classes/reportbuilder/local/filters/courserole.php
    admin/classes/reportbuilder/local/systemreports/task_logs.php
    admin/classes/reportbuilder/local/systemreports/users.php
    admin/classes/table/activity_management_table.php
    admin/classes/table/block_management_table.php
    admin/classes/table/editor_management_table.php
    admin/classes/table/hook_list_table.php
    admin/classes/table/media_management_table.php
    admin/classes/table/plugin_management_table.php
    admin/classes/table/plugin_management_table_filterset.php
    admin/classes/table/tool_plugin_management_table.php
    admin/cli/adhoc_task.php
    admin/cli/alternative_component_cache.php
    admin/cli/automated_backups.php
    admin/cli/backup.php
    admin/cli/build_theme_css.php
    admin/cli/cfg.php
    admin/cli/check_database_schema.php
    admin/cli/checks.php
    admin/cli/cron.php
    admin/cli/dashboard_reset.php
    admin/cli/delete_course.php
    admin/cli/emailstop.php
    admin/cli/fix_course_sequence.php
    admin/cli/fix_deleted_users.php
    admin/cli/fix_orphaned_calendar_events.php
    admin/cli/fix_orphaned_question_categories.php
    admin/cli/generate_key.php
    admin/cli/import.php
    admin/cli/install.php
    admin/cli/install_database.php
    admin/cli/kill_all_sessions.php
    admin/cli/maintenance.php
    admin/cli/mysql_collation.php
    admin/cli/mysql_compressed_rows.php
    admin/cli/purge_caches.php
    admin/cli/reset_password.php
    admin/cli/restore_backup.php
    admin/cli/scheduled_task.php
    admin/cli/svgtool.php
    admin/cli/uninstall_plugins.php
    admin/cli/upgrade.php
    admin/communication.php
    admin/contentbank.php
    admin/c
Aborting

If I do a git pull

git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> MOODLE_404_STABLE

which is what you saw.


THE FIX:
git fetch origin MOODLE_404_STABLE:LOCAL_MOODLE_404_STABLE

Returns:
From https://github.com/moodle/moodle
 * [new branch]              MOODLE_404_STABLE -> LOCAL_MOODLE_404_STABLE

now when I check 
git branch -a
I see
  LOCAL_MOODLE_404_STABLE
at the top but no tracking *

git branch --track MOODLE_404_STABLE origin/MOODLE_404_STABLE

now check again
git branch -a

and I see:
  LOCAL_MOODLE_404_STABLE
* MOODLE_404_STABLE
at the top - * indicates what branch tracking.

and finally ... FINALLY ... AFTER ALL THAT:

git pull
Already up to date

which is what I should see.

code directory now under git.

Here's my git history for above:

453  git init
  454  git remote add origin https://github.com/moodle/moodle/
  455  git checkout -b MOODLE_404_STABLE
  456  git branch -a
  457  git branch
  460  git pull
  462  git pull
  463  git branch -a
  475  git init
  476  git remote add origin https://github.com/moodle/moodle/
  477  git checkout -b MOODLE_404_STABLE
  478  git pull
  479  git branch --set-upstream-to=origin/main MOODLE_404_STABLE
  481  git branch -a
  482  git branch --set-upstream-to=remotes/origin/MOODLE_404_STABLE MOODLE_404_STABLE
  483  git branch --set-upstream-to=remotes/origin/MOODLE_404_STABLE
  484  git branch --set-upstream-to=remotes/origin/main
  485  git branch –track MOODLE_404_STABLE origin/MOODLE_404_STABLE
  486  git branch --set-upstream-to=remotes/origin/MOODLE_401_STABLE
  487  git branch -a
  488  git branch --set-upstream-to=remotes/origin/MOODLE_404_STABLE
  489  git branch --set-upstream-to='remotes/origin/MOODLE_404_STABLE'
  495  git pull
  498  ls -l .git*
  499  git branch -a
  507  git init
  508  git remote add origin https://github.com/moodle/moodle/
  509  git branch -a
  510  git checkout MOODLE_404_STABLE
  512  git remote add origin https://github.com/moodle/moodle
  513  git checkout -b MOODLE_404_STABLE
  514  git branch -a
  515  cd .git
  521  git fetch
  522  git branch -a
  524  git checkout -b MOODLE_404_STABLE
  525  git checkout MOODLE_404_STABLE
  526  git checkout -b MOODLE_404_STABLE
  527  git pull
  528  git pull remotes/origin/main /MOODLE_404_STABLE
  529  git pull remotes/origin/main 404
  530  git branch -a
  532  git checkout MOODLE_404_STABLE
  533  git checkout -b MOODLE_404_STABLE
  534  git branch -a
  535  git fetch origin MOODLE_404_STABLE:LOCAL_MOODLE_404_STABLE
  536  git branch -a
  537  git branch --track MOODLE_404_STABLE origin/MOODLE_404_STABLE
  538  git branch -a
  539  git pull
  540  history |grep git

What does yours look like?

I know what is easier ... GITIFY!   Plus added value of 3 useful bash shell scripts that one will use in maintaining a git Moodle.

Let me repeat:

I know what is easier ... GITIFY!   Plus added value of 3 useful bash shell scripts that one will use in maintaining a git Moodle.

'SoS', Ken

In reply to Paul Archer

Re: Adding the Git repository after Moodle is installed

Ken Task
Particularly helpful Moodlers 사진

@Paul

See Gitify Demo Video in my profile:

https://moodle.org/user/profile.php?id=141618

Video is long and you will see me make some mistakes ... corrected easily enough ... didn't rehearse very much. 슬픈

'SoS', Ken

In reply to Ken Task

Re: Adding the Git repository after Moodle is installed

Paul Archer
Hi Ken,

Thank you so much for you help and time.

I have used your script and it has updated me to Moodle 4.4.1+ (Build: 20240809)

How ever i noticed that the system tells me that there is a Moodle 4.4.3+ (Build: 20240910) | Version 2024042203.03 | Stable version

I did run the upgrade script - but that did not upgrade me

the gitifyvars look like (the user name and pass are not the real ones 윙크 )

shortmversion='441'
pathtobackupdir='/home/paul/backups'
codedir='/var/www/html/moodle'
pathtomoodledatadir='/var/moodledata'
datestamp='$(date +%Y%m%d%-H%M%S)'
dbuser='moodledude'
dbpass='passwordformoodledude'
dbname='moodle'
gitversion='404'

$ git status
On branch MOODLE_404_STABLE
Your branch is up to date with 'origin/MOODLE_404_STABLE'.

Changes not staged for commit:
(a number files listed in red in the screen)

Please forgive my lack of understanding

thanks

Paul
In reply to Paul Archer

Re: Adding the Git repository after Moodle is installed

Ken Task
Particularly helpful Moodlers 사진

Prior to running gitify, did you remove the .git directory, .github directory, .gitignore and .gitattributes from the code directory you were using?   You should have ... it would then be like starting over.

Also remember your site acquired the other way, was already on the highest stable branch.   So updates may not be a lot ... depending upon the 'point' release of core code.

Can you give me a clip of what screen showed when you said 

"Changes not staged for commit:
(a number files listed in red in the screen)"

git status - should have shown ...
On branch MOODLE_404_STABLE
Your branch is up to date with 'origin/MOODLE_404_STABLE'.

nothing to commit, working tree clean

You'll run update script more than upgrade.

upgrade script for upgrading to major version releases ... 4.4.x is the highest stable version.   4.5 is a dev release right now and you don't want that for a production site.

You run gitify just one time ... to get your moodle code under git versioning and the creation of the bu,update, upgrade scripts.   You should remove the zip file, the gitify script, the temp directory created to get the git core code, and the gitifyvars file from your code.

Now that you have the update and upgrade scripts, edit those giving correct git version numbers.

Venturing into git on an existing code base is mind boggling.  I've been doing this for some time now and I still have to pause and gather thoughts! 미소

What I think I'd try with yours:

Reissue the following commands in the code directory.  They are redunant but we are trying to make sure of things:

git branch --track MOODLE_404_STABLE origin/MOODLE_404_STABLE
git checkout MOODLE_404_STABLE

And then this one:

git reset --hard

and then check status.

using  git branch -a you should see the version tracking, the main.


* MOODLE_404_STABLE
  main
  remotes/origin/HEAD -> origin/main

Don't think you are coding ... so that 'commit' thing shouldn't apply to your use of git.

Have also sent my direct email address via PM here in forums.

Let's do direct as it's faster and we might have to discuss/cuss things about your system that we shouldn't be showing here in forums.

'SoS', Ken