ohmyzsh: unable to upgrade

Go to solution

[Oh My Zsh] Would you like to check for updates?
Type Y to update oh-my-zsh: Y
Upgrading Oh My Zsh
Cannot pull with rebase: You have unstaged changes.
Please commit or stash them.
There was an error updating. Try again later?

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Reactions: 43
  • Comments: 50 (2 by maintainers)

Most upvoted comments

  1. Open up Terminal
  2. Type in ‘~/.oh-my-zsh’, this should change your directory to the zsh directory. -Terminal should read: " .oh-my-zsh git:(master) ". If it does, go to step 3.
  3. Type in “git status” to see that your status is ahead of master. -If you’re not concerned about the file status changes, you can “stash” those changes by doing step 4.
  4. Type in “git stash” to save the progress in the git and move the head back to master.
  5. Done. Now you should be able to upgrade the next time the terminal asks you too.

Same problem… One liner fix.

cd "$ZSH" && git stash && upgrade_oh_my_zsh

Try

git stash

and then run the upgrade and then

git stash pop

after that to get your changes back.

Navigate into your .oh-my-zsh directory and do a ‘git status’ to see if there are any changes you made to existing files. If there are, I think you’ll have to revert those changes before you can update.

I already fixed this, try delete the option “—rebase” in tools/upgrade.sh

Improved one-line solution:

cd "$ZSH" && git stash && upgrade_oh_my_zsh && git stash pop

if any of the above does not work for you try this

cd ~/.oh-my-zsh
git config core.filemode false

It is happening most likely because you have edited something in your .oh-my-zsh directory but you have not committed it.

  1. Navigate to the directory.
  2. Run “git status”. It should display a list of files changed.
  3. Stage those files with “git add <insert filename>”
  4. Commit those changes with “git commit -m <insert your comment>”

You should be able to upgrade now.

Optional: After step 2, you may be able to just run "git commit -a -m <insert your comment> " which should stage all the unstaged files and commit those changes (combining step 3 and 4).

This worked for me and I hope it works for someone else too. No quotes or <> in those commands ( just in case (: )

And don’t forget to git stash pop after you upgrade to re-apply your changes (if desired).

$ sudo git reset --hard fixed this for me.

$ cd "$ZSH" && git stash    
error: 'custom/example.zsh' is beyond a symbolic link
fatal: Unable to process path custom/example.zsh
Cannot save the current worktree state

Caused by mackup operation.

If you confirm to ignore all changes mackup made. cd "$ZSH" && git reset --hard origin/HEAD && upgrade_oh_my_zsh should resolve this issue.

Don’t forget pop or you’ll loose the changes to your themes.

cd "$ZSH" && git stash && upgrade_oh_my_zsh && git stash pop

@ODelibalta is right if you concern your changes…

1. Navigate to the .oh-my-zsh/ directory. 2. Run git status. It should display a list of files changed. 3. Stage those files with git add [filename(s)] 4. Commit those changes with git commit -m

and then upgrade zsh via upgrade_oh_my_zsh command. enjoy!..

Have tried cd "$ZSH" && git stash && upgrade_oh_my_zsh, but it didn’t work for me. After that I tried follow the error to use rm -fr ".git/rebase-merge" and then upgrade_oh_my_zsh, resolved my issues.

It just an opinion, but it would help if after the error message is added a new line with a text like “(Oh My Zsh git repo): ~/.oh-my-zsh” so people like me and most people that like this project but are not maintainers nor *Zsh experts don’t have to google it.

Had similar experience with oh_my_zsh. Did not realize that the installation and upgrade are tied to the repo. Because I changed the CLI prompt in themes/agnoster.zsh-theme, it is identified as untracked changes and cause upgrade pull to fail. For now, the following steps works for me:

# Step 1: stash the untracked change
cd ~/.oh-my-zsh && git stash

# Step 2: Update by typing the following line in terminal
upgrade_oh_my_zsh

# Step 3: stash pop to recover untracked change
git stash pop

For those who are getting here when using babun on Windows, I recommend using @kayoub5’s method for fixing this (copied below):

cd ~/.oh-my-zsh
git config core.filemode false

Then just let it run the next update.

Thanks russelBradley !

Thanks russelBradley !

Thanks russelBradley 👍

Thanks @RussellBradley - that works!

Thanks russelBradley 👍

The one liner solved my issue. Thank you RussellBradley!

Thanks russelBradley 👍

I got it. I just solve some conflicts and the git rebase --continue.

👍 I’m experiencing this as well…