Cannot omz update due to unstaged changes

Issue

Every time I run omz update it tells me I have unstaged changes and forces me into a rebase.

❯ git rebase --continue
CONFLICT (modify/delete): plugins/boot2docker/README.md deleted in HEAD and modified in dafdce47 (commiting recent changes).  Version dafdce47 (commiting recent changes) of plugins/boot2docker/README.md left in tree.
CONFLICT (modify/delete): plugins/boot2docker/_boot2docker deleted in HEAD and modified in dafdce47 (commiting recent changes).  Version dafdce47 (commiting recent changes) of plugins/boot2docker/_boot2docker left in tree.
CONFLICT (modify/delete): plugins/cargo/README.md deleted in HEAD and modified in dafdce47 (commiting recent changes).  Version dafdce47 (commiting recent changes) of plugins/cargo/README.md left in tree.
CONFLICT (modify/delete): plugins/copydir/README.md deleted in HEAD and modified in dafdce47 (commiting recent changes).  Version dafdce47 (commiting recent changes) of plugins/copydir/README.md left in tree.
CONFLICT (modify/delete): plugins/copydir/copydir.plugin.zsh deleted in HEAD and modified in dafdce47 (commiting recent changes).  Version dafdce47 (commiting recent changes) of plugins/copydir/copydir.plugin.zsh left in tree.
CONFLICT (modify/delete): plugins/gb/README.md deleted in HEAD and modified in dafdce47 (commiting recent changes).  Version dafdce47 (commiting recent changes) of plugins/gb/README.md left in tree.
CONFLICT (modify/delete): plugins/gb/_gb deleted in HEAD and modified in dafdce47 (commiting recent changes).  Version dafdce47 (commiting recent changes) of plugins/gb/_gb left in tree.
CONFLICT (modify/delete): plugins/httpie/httpie.plugin.zsh deleted in HEAD and modified in dafdce47 (commiting recent changes).  Version dafdce47 (commiting recent changes) of plugins/httpie/httpie.plugin.zsh left in tree.
CONFLICT (modify/delete): plugins/npx/README.md deleted in HEAD and modified in dafdce47 (commiting recent changes).  Version dafdce47 (commiting recent changes) of plugins/npx/README.md left in tree.
CONFLICT (modify/delete): plugins/npx/npx.plugin.zsh deleted in HEAD and modified in dafdce47 (commiting recent changes).  Version dafdce47 (commiting recent changes) of plugins/npx/npx.plugin.zsh left in tree.
CONFLICT (modify/delete): plugins/osx/README.md deleted in HEAD and modified in dafdce47 (commiting recent changes).  Version dafdce47 (commiting recent changes) of plugins/osx/README.md left in tree.
CONFLICT (modify/delete): plugins/osx/osx.plugin.zsh deleted in HEAD and modified in dafdce47 (commiting recent changes).  Version dafdce47 (commiting recent changes) of plugins/osx/osx.plugin.zsh left in tree.
error: could not apply dafdce47... commiting recent changes
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
❯ gs
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)

Last command done (1 command done):
   pick dafdce47 commiting recent changes
No commands remaining.
You are currently rebasing branch 'master' on '6d48309c'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)

Unmerged paths:
  (use "git restore --staged <file>..." to unstage)
  (use "git add/rm <file>..." as appropriate to mark resolution)
        deleted by us:   plugins/boot2docker/README.md
        deleted by us:   plugins/boot2docker/_boot2docker
        deleted by us:   plugins/cargo/README.md
        deleted by us:   plugins/copydir/README.md
        deleted by us:   plugins/copydir/copydir.plugin.zsh
        deleted by us:   plugins/gb/README.md
        deleted by us:   plugins/gb/_gb
        deleted by us:   plugins/httpie/httpie.plugin.zsh
        deleted by us:   plugins/npx/README.md
        deleted by us:   plugins/npx/npx.plugin.zsh
        deleted by us:   plugins/osx/README.md
        deleted by us:   plugins/osx/osx.plugin.zsh

Things I’ve tried include:

  • git reset --hard
  • cd "$ZSH" && git stash && upgrade_oh_my_zsh && git stash pop
  • git mergetool x2, first selecting the deleted file then selecting the modified file on remote
  • git fetch && git merge
  • git pull

A git pull origin master runs just fine as does git merge

From https://github.com/ohmyzsh/ohmyzsh
 * branch              master     -> FETCH_HEAD
Already up to date.
❯ git merge
Already up to date.

But I cannot for the life of me figure out why I’m unable to update omz. Is there a way I can just nuke it and start from scratch?

Solution

One of the helpful contributors at the oh-my-zsh repo helped me out per this existing issue

cd $ZSH

git reset –hard origin/master

omz update

Answered By – Sandwich Heat

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published