Skip to content
Weik.ioUniversity
Try Weik.io

Deleting and undoing through Git

GitOps 2 · 3:59

Removing a deployment document from Git and applying removes the deployment from Weik.io, and a revert brings it back without a new build. The video continues GitOps 1 and covers drift from a change made by hand.

Download the mp4Recorded on 2026.2

What it covers

  • Deleting hello's deployment document with git rm and committing the change
  • A plan with weikio diff, showing would delete for the deployment and exit code 2
  • Applying with the prune name sandbox, which deletes the deployment and leaves the integration as it was
  • Seeing devtest marked Not deployed on hello's page in the admin UI
  • Two git revert commits, the first recreating the deployment and the second returning it to 0.2.0
  • Stopping hello by hand, with the drift in the plan and the next apply starting it again

Commands in this video

Terminal
$ git rm sandbox/devtest/deployments/hello.yaml
$ git commit -m 'remove hello from devtest'
$ weikio diff -f sandbox/shared -f sandbox/devtest --env devtest --prune sandbox
$ echo $?
$ weikio apply -f sandbox/shared -f sandbox/devtest --env devtest --prune sandbox -y
$ git revert --no-edit HEAD
$ git revert --no-edit ba8cf4a
$ weikio stop sandbox/hello
Transcript
  1. 0:06The repository is where the earlier GitOps video left hello.
  2. 0:11devtest runs hello's deployment at version 0.2.1.
  3. 0:16The arc is the plan before every apply,
  4. 0:19comparing the folders with your Weik.io installation.
  5. 0:22An apply with a prune name clears the installation of documents past applies under that name put there and the folder no longer holds.
  6. 0:35git rm takes hello's deployment file out of the folder.
  7. 0:39The file is gone,
  8. 0:41while the variable file and hello's files under sandbox/shared stay.
  9. 0:47A commit named remove hello from devtest records the removal.
  10. 0:52Nothing has reached the installation, because an apply carries the change.
  11. 1:02weikio diff is the plan: the folders, devtest, the prune name sandbox.
  12. 1:08The deployment row reads would delete.
  13. 1:11Exit code 2 means the apply would change something.
  14. 1:17The same folders, devtest and the prune name sandbox go through the apply,
  15. 1:22with the yes answer up front.
  16. 1:25The deployment row reads deleted, the integration row unchanged.
  17. 1:34hello's page in the admin UI reads Not deployed for devtest and offers Deploy.
  18. 1:44git revert for the removal commit keeps the message Git writes,
  19. 1:48which quotes what it undoes.
  20. 1:51The deployment file stands in sandbox/devtest/deployments again.
  21. 1:58The same apply runs again, with the prune name and the yes answer,
  22. 2:02and its last row reads created.
  23. 2:05This apply writes a new deployment record for version 0.2.1.
  24. 2:14The devtest card runs hello at version 0.2.1, where the last apply left it.
  25. 2:21This revert goes back to the older commit that raised hello to version 0.2.1.
  26. 2:30Version 0.2.0 is still in the installation, so the plan only moves the deployment back,
  27. 2:37reading changed version 0.2.1 to 0.2.0.
  28. 2:43The apply moves the deployment to version 0.2.0.
  29. 2:50Someone stops hello by hand, and nothing in the repository changes.
  30. 2:57The plan reads would update, changed state stopped to started.
  31. 3:02Exit code 2 again: the installation has drifted from the folders.
  32. 3:08The apply puts hello back to the state its file states.
  33. 3:16hello's page in the admin UI agrees.
  34. 3:19The Environments card reads devtest at version 0.2.0 on agent dev,
  35. 3:26and names 0.2.1 as the version before.
  36. 3:34The removal took hello's deployment document away,
  37. 3:37and the apply with the prune deleted the deployment.
  38. 3:41A revert brought the file back,
  39. 3:43and an apply created the deployment with nothing built.
  40. 3:46An apply puts drift back, and a nightly plan is how teams hear of it.

Sign in to the live demo

Sign in with the shared viewer account, which can open every screen of the example projects and can't change anything.

E-mail
viewer@demo.weik.io
Password
try-weikio-live-demo
Open the live demo