How can I switch the branch of the OctoPrint installation on my OctoPi image?



You'll first need to ssh into your Pi or optionally connect it to an external keyboard and monitor and open a command line terminal.

:warning: Warning

Do not use sudo for the git, pip or python commands below!

If you need sudo in order to switch branches, you broke something on your OctoPi installation (probably by using sudo accidentally earlier) and you need to fix your permissions, not just blindly put sudo in front of commands until stuff works.

Perform the following steps:

cd ~/OctoPrint
source ~/oprint/bin/activate
git fetch
git checkout <branch>
git pull
python clean
pip install .
sudo service octoprint restart

Replace <branch> above by the branch you want to switch to, e.g. maintenance.

You'll want to switch the Software Update plugin to "Commit" tracking, otherwise you'll get prompted to reverting to a stable release.