<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Git-enabling an Existing Moodle Installation: A Step-by-Step Guide	</title>
	<atom:link href="https://www.elearningworld.org/git-enabling-an-existing-moodle-installation-a-step-by-step-guide/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.elearningworld.org/git-enabling-an-existing-moodle-installation-a-step-by-step-guide/</link>
	<description>For the online learning world</description>
	<lastBuildDate>Fri, 25 Aug 2023 17:21:20 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: Michael Milette		</title>
		<link>https://www.elearningworld.org/git-enabling-an-existing-moodle-installation-a-step-by-step-guide/#comment-1649</link>

		<dc:creator><![CDATA[Michael Milette]]></dc:creator>
		<pubDate>Fri, 25 Aug 2023 17:21:20 +0000</pubDate>
		<guid isPermaLink="false">https://www.elearningworld.org/?p=16451#comment-1649</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.elearningworld.org/git-enabling-an-existing-moodle-installation-a-step-by-step-guide/#comment-1648&quot;&gt;Gareth Barnard&lt;/a&gt;.

Hi Gareth,

Sounds to me like you have some excellent Git processes and practices. I do much of the same except that I usually use just the Git command line. When I first started with Git many years ago, I tried a few Git GUIs. However, I always ended up frustrated with their limitations. So I focused on using Git command line and haven&#039;t looked back since. The only GUI-like tool that I use for Git is lazygit (available for Windows, MacOS and Linux). Despite the fact that it is a text-based tool, it still works with a mouse. I use this to split up changes into multiple commits when I&#039;ve made unrelated fixes along the way but it is capable of so much more. If you are curious. take a look at this open source project at https://github.com/jesseduffield/lazygit.

Best regards,

Michael]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.elearningworld.org/git-enabling-an-existing-moodle-installation-a-step-by-step-guide/#comment-1648">Gareth Barnard</a>.</p>
<p>Hi Gareth,</p>
<p>Sounds to me like you have some excellent Git processes and practices. I do much of the same except that I usually use just the Git command line. When I first started with Git many years ago, I tried a few Git GUIs. However, I always ended up frustrated with their limitations. So I focused on using Git command line and haven&#8217;t looked back since. The only GUI-like tool that I use for Git is lazygit (available for Windows, MacOS and Linux). Despite the fact that it is a text-based tool, it still works with a mouse. I use this to split up changes into multiple commits when I&#8217;ve made unrelated fixes along the way but it is capable of so much more. If you are curious. take a look at this open source project at <a href="https://github.com/jesseduffield/lazygit" rel="nofollow ugc">https://github.com/jesseduffield/lazygit</a>.</p>
<p>Best regards,</p>
<p>Michael</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Gareth Barnard		</title>
		<link>https://www.elearningworld.org/git-enabling-an-existing-moodle-installation-a-step-by-step-guide/#comment-1648</link>

		<dc:creator><![CDATA[Gareth Barnard]]></dc:creator>
		<pubDate>Thu, 24 Aug 2023 20:17:53 +0000</pubDate>
		<guid isPermaLink="false">https://www.elearningworld.org/?p=16451#comment-1648</guid>

					<description><![CDATA[Hi Michael,

Thanks for your reply.  As a plugin and occasional core developer, I do use Git on the command line for cherry picking and hard resets.  For ease of use though, I do use a GUI.  Generally each bit of functionality has its own commit.  If a bit of work is going to take time and needs to be interleaved with other work, then I&#039;ll branch off, do several commits, then when finished make a &#039;merge&#039; branch, squash the commits and then merge that branch into master.  That then gives a single commit that can then be cherry picked to previous versions of Moodle branches.  I&#039;ll rebase if needed.  Matching versions is easy as I (like core releases) tag them.  The tags are used when uploading to the Moodle dot org plugins DB too, thus a match between that and the repository.

Kind regards,

Gareth]]></description>
			<content:encoded><![CDATA[<p>Hi Michael,</p>
<p>Thanks for your reply.  As a plugin and occasional core developer, I do use Git on the command line for cherry picking and hard resets.  For ease of use though, I do use a GUI.  Generally each bit of functionality has its own commit.  If a bit of work is going to take time and needs to be interleaved with other work, then I&#8217;ll branch off, do several commits, then when finished make a &#8216;merge&#8217; branch, squash the commits and then merge that branch into master.  That then gives a single commit that can then be cherry picked to previous versions of Moodle branches.  I&#8217;ll rebase if needed.  Matching versions is easy as I (like core releases) tag them.  The tags are used when uploading to the Moodle dot org plugins DB too, thus a match between that and the repository.</p>
<p>Kind regards,</p>
<p>Gareth</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Michael Milette		</title>
		<link>https://www.elearningworld.org/git-enabling-an-existing-moodle-installation-a-step-by-step-guide/#comment-1647</link>

		<dc:creator><![CDATA[Michael Milette]]></dc:creator>
		<pubDate>Wed, 23 Aug 2023 15:58:32 +0000</pubDate>
		<guid isPermaLink="false">https://www.elearningworld.org/?p=16451#comment-1647</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.elearningworld.org/git-enabling-an-existing-moodle-installation-a-step-by-step-guide/#comment-1646&quot;&gt;Gareth Barnard&lt;/a&gt;.

Hi Gareth,

Thank you for your questions.

&lt;strong&gt;Risk of Mistakes:&lt;/strong&gt; Certainly, there are risks involved. However, if you maintain discipline in committing your changes to an online Git repository, the risks are significantly lower compared to relying on memory and a manual process for updating the Moodle LMS. Just remember to use the --rebase option, otherwise, your Git log could become messy, making it difficult to differentiate between core code and custom commits.

&lt;strong&gt;Use a Test Installation:&lt;/strong&gt; Absolutely. I recommend utilizing a test installation whenever you make code changes to your Moodle LMS site. Nevertheless, I&#039;ve encountered clients without a test setup and a limited maintenance budget. In such cases, I structured things so that their webmaster simply needed to back up the site, access a terminal, and execute the &#039;git pull --rebase&#039; command a few times annually. If any issues arose during this process, they were instructed to note the error and use &#039;git rebase --abort&#039; to revert changes. If they encountered no errors but the site didn&#039;t function post-update, they were advised to restore the backup. So far, there haven&#039;t been any complaints.

&lt;strong&gt;3rd Party Plugins:&lt;/strong&gt; Managing them using Git is feasible, although each plugin requires individual management since they are separate from Moodle. Note that installing a plugin via Git will prevent Moodle from allowing updates within the platform if it detects the .git directory. Additionally, it might be slightly challenging to identify the matching commit for the installed version. Unless a plugin has been customized, it&#039;s simpler to clone the entire repository, ensuring you checkout the relevant branch for your Moodle version, and then replace existing files. For customized plugins, Git can be handy to update the plugin and reapply customizations over the updated version. Occasionally, I create a bash script to automate Moodle and plugin updates. This script can even roll back changes in case of issues or execute the Moodle database update script, streamlining the process. Just remember to update the script when adding or removing 3rd party plugins.

&lt;strong&gt;Submodules:&lt;/strong&gt; Implementing this with plugins as submodules is indeed possible. The success largely depends on the implementation. When handled correctly, the Moodle Git repository doesn&#039;t distinguish between submodules and non-submodule custom commits. Since custom commits are always integrated atop the base Moodle, it functions similarly to any other custom commit not part of the core.

&lt;strong&gt;Tip:&lt;/strong&gt; I&#039;ve found that maintaining a sustainable, long-term code management solution using Git involves making individual commits for each fix, new feature, or addition/removal of a 3rd party plugin, rather than combining multiple changes into one. Merge (squash) commits related to one issue into a single commit. This approach keeps your Git log clean and understandable. When it comes time to implementing Moodle upgrades down the road, you will be able to simply cherry-pick your custom commits into the new Moodle branch, hopefully with minimal merge conflicts. Using &#039;git log&#039; allows you to view your custom commits at the top of the list, above Moodle core commits.

Git is an invaluable tool for source code management. As you customize your site&#039;s over time, its maintenance process will naturally become more intricate. However, once you grasp Git&#039;s capabilities and learn to harness them, it can significantly reduce your workload.

Git&#039;s learning curve might seem steep, but dedicating time to grasp its fundamental functions pays off in the long run. For example, as a developer, I maintain multiple releases of Moodle locally for compatibility testing. Using &#039;git pull --rebase,&#039; updates each instance of Moodle in a mere minute or two, sometimes even less (depending on your computer and Internet speeds). Git promptly notifies me of the successful application of customizations over the latest Moodle version and of any source code integration issues.

There&#039;s so much more to share about using Git for Moodle site source code management, but I believe this already exceeds the scope of a comment.

Hope you found something helpful in this information.

Best regards,

Michael Milette]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.elearningworld.org/git-enabling-an-existing-moodle-installation-a-step-by-step-guide/#comment-1646">Gareth Barnard</a>.</p>
<p>Hi Gareth,</p>
<p>Thank you for your questions.</p>
<p><strong>Risk of Mistakes:</strong> Certainly, there are risks involved. However, if you maintain discipline in committing your changes to an online Git repository, the risks are significantly lower compared to relying on memory and a manual process for updating the Moodle LMS. Just remember to use the &#8211;rebase option, otherwise, your Git log could become messy, making it difficult to differentiate between core code and custom commits.</p>
<p><strong>Use a Test Installation:</strong> Absolutely. I recommend utilizing a test installation whenever you make code changes to your Moodle LMS site. Nevertheless, I&#8217;ve encountered clients without a test setup and a limited maintenance budget. In such cases, I structured things so that their webmaster simply needed to back up the site, access a terminal, and execute the &#8216;git pull &#8211;rebase&#8217; command a few times annually. If any issues arose during this process, they were instructed to note the error and use &#8216;git rebase &#8211;abort&#8217; to revert changes. If they encountered no errors but the site didn&#8217;t function post-update, they were advised to restore the backup. So far, there haven&#8217;t been any complaints.</p>
<p><strong>3rd Party Plugins:</strong> Managing them using Git is feasible, although each plugin requires individual management since they are separate from Moodle. Note that installing a plugin via Git will prevent Moodle from allowing updates within the platform if it detects the .git directory. Additionally, it might be slightly challenging to identify the matching commit for the installed version. Unless a plugin has been customized, it&#8217;s simpler to clone the entire repository, ensuring you checkout the relevant branch for your Moodle version, and then replace existing files. For customized plugins, Git can be handy to update the plugin and reapply customizations over the updated version. Occasionally, I create a bash script to automate Moodle and plugin updates. This script can even roll back changes in case of issues or execute the Moodle database update script, streamlining the process. Just remember to update the script when adding or removing 3rd party plugins.</p>
<p><strong>Submodules:</strong> Implementing this with plugins as submodules is indeed possible. The success largely depends on the implementation. When handled correctly, the Moodle Git repository doesn&#8217;t distinguish between submodules and non-submodule custom commits. Since custom commits are always integrated atop the base Moodle, it functions similarly to any other custom commit not part of the core.</p>
<p><strong>Tip:</strong> I&#8217;ve found that maintaining a sustainable, long-term code management solution using Git involves making individual commits for each fix, new feature, or addition/removal of a 3rd party plugin, rather than combining multiple changes into one. Merge (squash) commits related to one issue into a single commit. This approach keeps your Git log clean and understandable. When it comes time to implementing Moodle upgrades down the road, you will be able to simply cherry-pick your custom commits into the new Moodle branch, hopefully with minimal merge conflicts. Using &#8216;git log&#8217; allows you to view your custom commits at the top of the list, above Moodle core commits.</p>
<p>Git is an invaluable tool for source code management. As you customize your site&#8217;s over time, its maintenance process will naturally become more intricate. However, once you grasp Git&#8217;s capabilities and learn to harness them, it can significantly reduce your workload.</p>
<p>Git&#8217;s learning curve might seem steep, but dedicating time to grasp its fundamental functions pays off in the long run. For example, as a developer, I maintain multiple releases of Moodle locally for compatibility testing. Using &#8216;git pull &#8211;rebase,&#8217; updates each instance of Moodle in a mere minute or two, sometimes even less (depending on your computer and Internet speeds). Git promptly notifies me of the successful application of customizations over the latest Moodle version and of any source code integration issues.</p>
<p>There&#8217;s so much more to share about using Git for Moodle site source code management, but I believe this already exceeds the scope of a comment.</p>
<p>Hope you found something helpful in this information.</p>
<p>Best regards,</p>
<p>Michael Milette</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Gareth Barnard		</title>
		<link>https://www.elearningworld.org/git-enabling-an-existing-moodle-installation-a-step-by-step-guide/#comment-1646</link>

		<dc:creator><![CDATA[Gareth Barnard]]></dc:creator>
		<pubDate>Wed, 23 Aug 2023 10:47:39 +0000</pubDate>
		<guid isPermaLink="false">https://www.elearningworld.org/?p=16451#comment-1646</guid>

					<description><![CDATA[A really interesting and different approach Michael.  Is there a risk with using Git on a production folder of potential mistakes in the future?  And therefore better to do this with a test installation and then update with config.php backup, file remove / copy etc?  Also, given that 3rd party plugins have Git repositories too, then could they be migrated in the same light?  Possibly added as submodules (https://git-scm.com/book/en/v2/Git-Tools-Submodules) or standalone but just needing to be aware of not removing them untracked wise.  I have several development installs and use both methods for no particular reason as not thought about it until now!]]></description>
			<content:encoded><![CDATA[<p>A really interesting and different approach Michael.  Is there a risk with using Git on a production folder of potential mistakes in the future?  And therefore better to do this with a test installation and then update with config.php backup, file remove / copy etc?  Also, given that 3rd party plugins have Git repositories too, then could they be migrated in the same light?  Possibly added as submodules (<a href="https://git-scm.com/book/en/v2/Git-Tools-Submodules" rel="nofollow ugc">https://git-scm.com/book/en/v2/Git-Tools-Submodules</a>) or standalone but just needing to be aware of not removing them untracked wise.  I have several development installs and use both methods for no particular reason as not thought about it until now!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Stuart		</title>
		<link>https://www.elearningworld.org/git-enabling-an-existing-moodle-installation-a-step-by-step-guide/#comment-1642</link>

		<dc:creator><![CDATA[Stuart]]></dc:creator>
		<pubDate>Mon, 21 Aug 2023 01:42:08 +0000</pubDate>
		<guid isPermaLink="false">https://www.elearningworld.org/?p=16451#comment-1642</guid>

					<description><![CDATA[Great post Michael !
I&#039;ve always avoided git, bur might actually give it a go after reading this :-)]]></description>
			<content:encoded><![CDATA[<p>Great post Michael !<br />
I&#8217;ve always avoided git, bur might actually give it a go after reading this 🙂</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
