Error codes & fixes: Git, Terraform & Helm errors
6 Error codes & fixes commands: Git, Terraform & Helm errors. Click a command to see what each part does.
Git, Terraform & Helm errors6
git pull --rebase origin <branch>rejected (non-fast-forward)"Updates were rejected because the remote contains work that you do not have"What it means
Someone pushed to the branch since you last pulled; a plain push would overwrite their work.
Usual causes & fixes
- Pull with rebase, resolve conflicts, then
git push. - Only after a deliberate rebase of your own branch:
git push --force-with-lease.
Diagnose: what each part of the command does
pull --rebasefetch the remote commits and replay yours on toporigin <branch>the branch you are pushing
- Pull with rebase, resolve conflicts, then
git diff --name-only --diff-filter=UCONFLICTMerge conflict: which files?What it means
Both sides changed the same lines; Git marked them with <<<<<<< ======= >>>>>>>.
Usual causes & fixes
- Edit the files, remove the markers,
git add <file>, thengit commit(orgit rebase --continue). - Give up:
git merge --abort/git rebase --abort.
Diagnose: what each part of the command does
--name-onlylist file names only--diff-filter=Uonly Unmerged (conflicted) files
- Edit the files, remove the markers,
git switch -c <new-branch>detached HEADKeep work done in detached HEADWhat it means
You checked out a commit or tag directly, not a branch. New commits belong to no branch.
Usual causes & fixes
- Already switched away? Find the commit in
git reflog.
Diagnose: what each part of the command does
switch -c <new-branch>create a branch at the current commit so the work is not lost
- Already switched away? Find the commit in
git rev-parse --show-toplevelnot a git repository"fatal: not a git repository"What it means
The current folder is not inside a Git working tree.
Usual causes & fixes
cdinto the repo, orgit init/git clonefirst.- In CI/containers: "dubious ownership" →
git config --global --add safe.directory <path>.
Diagnose: what each part of the command does
rev-parse --show-toplevelprint the repo root, or fail if you are not inside a repo
terraform force-unlock <lock-id>state lockTerraform "Error acquiring the state lock"DestructiveWhat it means
Another run holds the state lock, or a crashed/cancelled run left it behind.
Usual causes & fixes
- Make sure no other plan/apply is running first.
- Avoid by not cancelling apply jobs; use a CI concurrency group per workspace.
Diagnose: what each part of the command does
force-unlock <lock-id>remove the lock (ID is in the error message)
helm history <release> -n <namespace>another operation in progressHelm "another operation (install/upgrade/rollback) is in progress"What it means
A previous Helm operation was interrupted and left the release in a pending state.
Usual causes & fixes
- Roll back to the last deployed revision:
helm rollback <release> <revision> -n <namespace>. - Use
--rollback-on-failure(Helm 4) /--atomic(Helm 3) and a timeout so this cleans up itself.
Diagnose: what each part of the command does
history <release>revisions; the last one is stuck in pending-install / pending-upgrade
- Roll back to the last deployed revision:
Nothing matches.
My DevOps Playbook by Angelo John Calleja