34.1. The code for the training#
You can get the complete code for this training from GitHub. See Installation.
The main training project is mastering-plone-project.
The add-on developed in chapter 31 is mastering-plone-votable-add-on.
Both of these repositories are monorepos which contain:
a backend package
a frontend package
Makefile commands to use during development
configuration for automatic continuous integration workflows on GitHub
Get the code for a particular chapter#
The default branches of these repositories hold the code of the final chapter of the training. Each chapter that adds code to the package has a tag that can be used to get the code for that chapter.
To use the code for a certain chapter, you need to checkout the appropriate tag for the chapter. The package will then contain the complete code for that chapter (excluding exercises).
If you want to add the code for the chapter yourself, you have to check out the tag of the previous chapter. Each chapter has a card at the top which tells you which tags to use. The full list of tags is also shown in a table below.
How to check out a tag of a git repository#
You have two options: terminal or source editor (for example VSCode).
Terminal
cdto the folder which contains the repository (mastering-plone-project).To check out the tag
talks:git checkout talks
VSCode
Open
mastering-plone-projectin VSCode.If not installed, install the extension "GitHub Pull Requests".
Open the source control sidebar.
Select the tag.
Check out a tag#
Move from chapter to chapter#
To change the code to the state of the next chapter, check out the tag for the next chapter:
git checkout views_3
If you made any changes to the code, you have to get them out of the way first. This involves two things.
Warning
Make sure you have no new files or changes in the folder structure of mastering-plone-project that you want to keep, because the following will delete them!
git clean -fd
git stash
This does two things:
It deletes any files that you added and are not part of the package.
It will move away changes to files that are part of the package but not delete them. You can get them back later. You should learn about the command git stash before you try to reapply stashed changes.