10

I opened a terminal window and Oh My Zsh wanted to check for updates. I entered Y for yes and then I got the error message:

Cannot pull with rebase: You have unstaged changes.
Please commit or stash them.

I tried git status and Git told me that the current directory wasn't a repository (which didn't surprise me).

So, what is it complaining about?

3
  • You made a changes to the config files probably. go to your oh-my-zsh directory and type in git status. You will see that some files have been modified. you can type in git stash to temporarily get rid of those changes, and attempt updating again.
    – mnmnc
    Jun 3, 2015 at 15:31
  • That's exactly what happened. Will you make your comment an answer and I'll mark it?
    – n8mob
    Jun 3, 2015 at 15:34
  • Sure, I've just posted an answer.
    – mnmnc
    Jun 5, 2015 at 0:00

4 Answers 4

6

You made a changes to the config files probably. Go to your oh-my-zsh directory and type in git status.

Results for me (i've changed one of the themes):

╭─ jane  ~
╰─ λ cd .oh-my-zsh                                                      1:57:10
╭─ jane  ~/.oh-my-zsh  ‹master*›
╰─ λ git status                                                         1:57:17
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   themes/bira.zsh-theme

no changes added to commit (use "git add" and/or "git commit -a")

You will see that some files have been modified.

You can type in git stash to temporarily get rid of those changes, and attempt updating again.

3

Here is what I had to do to fix it:

cd ~/.oh-my-zsh/
git add .
git commit -m "commit message"
upgrade_oh_my_zsh

Don't forget the "." at the end of 2nd line

1
  • Does that allow you to keep your changes, or does the oh-my-zsh update overwrite with them? Or does it not matter because your changes didn't conflict? (Or something weirder?)
    – n8mob
    May 23, 2017 at 22:16
2

Oneliner solution

cd "$ZSH" && git stash && upgrade_oh_my_zsh && git stash pop
  1. cd "$ZSH" change tu current ZSH directory.
  2. git stash stage your local changes and head back to master via git.
  3. upgrade_oh_my_zsh upgrade ohMyZsh
  4. git stash pop to keep the changes, probably your themes.
0

If you're okay with dropping any of your local changes, then run:

git checkout -f master
git pull

This makes sure you're up to date and removes any mess from your local machine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .