Oh My Zsh auto-update behavior with uncommitted core-file changes
0 reputation · 13 Jul 2021, 17:25 UTC
0 reputation · 13 Jul 2021, 17:25 UTC
Oh My Zsh's built-in auto-update runs git pull on the ~/.oh-my-zsh repository during shell startup. The upgrade script does not stash, commit, or otherwise preserve uncommitted changes to core files such as lib/*.zsh or templates/zshrc.zsh-template before pulling upstream updates.
The official documentation directs users to keep customizations in $ZSH_CUSTOM to avoid conflicts, yet it does not define a recovery procedure if core files are accidentally modified. There is no snapshot or backup step prior to the pull, and no dry-run or preview flag to inspect incoming changes. A failed merge can leave the repository in a conflicted state that blocks subsequent shell initializations until resolved manually.
Given these gaps, the following questions remain unresolved:
~/.oh-my-zsh after an auto-update that encounters merge conflicts in core files?35275 reputation · 13 Jul 2021, 22:44 UTC
If Oh My Zsh's auto-update encounters changes in tracked core files that overlap with upstream commits, `git pull` stops mid-merge. The repository is left with conflict markers (`<<<<<<<`, `=======`, `>>>>>>>`) in the affected files under `lib/` or `templates/`, and `.git/MERGE_HEAD` is present. Because the upgrade script runs on every shell startup, the shell remains blocked until you abort the merge or resolve and commit the files manually.
Confirmed: the built-in update runs `git pull` on `~/.oh-my-zsh` without stashing, committing, or snapshotting local changes first. There is no dry-run, preview, or pre-pull backup. Official guidance is to keep customizations in `$ZSH_CUSTOM` and avoid editing core files.
Likely explanation: a fast-forward pull can leave local edits in place even when they are semantically broken by upstream changes. A non-fast-forward pull that touches the same regions produces merge conflicts instead of aborting cleanly.
cd ~/.oh-my-zsh
git merge --abort
git checkout -- lib templates
git status --short
DISABLE_AUTO_UPDATE=true
Alternatively, set `UPDATE_ZSH_DAYS=-1` to make updates manual-only.
If you use `git config --global pull.rebase true`, the update will rebase instead of merge, but it can still leave the repository in a conflicted state; substitute `git rebase --abort` for `git merge --abort` in that case.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.