oh my zsh… oh! my!

提示更新oh my zsh,当然更新!提示:

1
2
3
4
Updating Oh My Zsh
error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.
There was an error updating. Try again later?

尝试手动更新:upgrade_oh_my_zsh,依旧报错。

原因在报错中已经提示了:You have unstaged changes.,因为修改了git文件。

如果想保留修改,可以采用如下方式:

1
2
3
4
5
cd ~/.oh-my-zsh
git status
git stash
upgrade_oh_my_zsh
git stash pop

不想保留就按照git提交丢弃本地修改的方式即可。