Best practice for plugin-repository

Best practice for plugin-repository

by René Hilgemann -
Number of replies: 2

Hello,

I am actually learning how to write plugins and I am trying to figure out what is the best practice relating git

What i have done so far (relating git) is:

1. Cloned https://github.com/moodle/moodle.git
2. Checkout of MOODLE_311_STABLE

I know that I need an own repository for the plugin, but I am unsure how to add changes etc. to my plugin repository without affecting the main repository. I know there is a lot of tutorials/manuals out there but it's so much that I am confused what is the right way for me (some sources are very old or depricated and so on...)

Maybe: 

3. Create a git submodule in a new subdirectory inside the main moodle directory??

Another option would be to just download the MOODLE_311_STABLE-branch as a zip-file but that sounds a bit odd/unprofessional. 

Some links with the actual way to go would be enough!

Thanks!  smile


Average of ratings: -
In reply to René Hilgemann

Re: Best practice for plugin-repository

by René Hilgemann -
Trying to answer my own question:

Use "git clone git://github.com/YOUR_GITHUB_USERNAME/moodle.git LOCALDIR" to have only read access to main repo (see https://docs.moodle.org/dev/Git_for_developers)

And for the plugin repo I can just have a second repository (local) inside the moodle repo and changes inside that won't affect the moodle repo anyway (I expected that this is not able to be honest...)
In reply to René Hilgemann

Re: Best practice for plugin-repository

by Benjamin Ellis -
Picture of Particularly helpful Moodlers

Hi,

If you use submodules, all you need is a repo for your plugin only and you can separate the Moodle codebase.  Generally, I have a local clone of the Moodle repo and I clone single branches into my webserver development environment, then I create my plugin as a submodule with an upstream on Github.  That way I only am only using my plugin code and occasionally I will update the Moodle code without affecting my plugin development.




Average of ratings: Useful (1)