brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: Detach from Git in Portainer only downloads the main compose file

Git
~/tips/tip-portainer-detach-from-git

cat ~/tips/tip-portainer-detach-from-git.md

Turns a Git-based Portainer stack into a normal editable stack, with a few files left behind.

Sometimes a Git stack in Portainer needs to become a normal stack. There is a button for that, and it comes with a surprise.

Open the stack and click Detach from Git. Portainer stops following the repository and keeps the stack as a web editor stack, where you can edit the Compose file right in Portainer.

The docs are clear about the limits. Only the main Compose file is downloaded. Extra Compose files you listed under additional paths are not, and neither are .env files. If your stack depended on them, the detached stack may deploy differently or fail on its next redeploy.

The other warning is that you cannot undo it. Future Git updates stop, and the only way back is to deploy a new stack from the repository.

So before you click, open the repository and make a note of every file the stack used. Then recreate the variables in the editor by hand.

If you only want to try a change, a copy is safer than detaching. The Create template button on the stack page can save the stack as a template first, so you keep something to go back to.

Further reading: Edit a stack, On this site: turn on Re-pull image in a Portainer Git stack so updates really update, On this site: in a Portainer stack, env_file stack.env is not the same as a .env file

More Git tips git show-branch main feature git log --stat -5 git merge --no-ff feature -m "Merge feature" git merge --squash feature git merge --abort All Git tips (144) All topics

Link