How to update ZSH and maintain local changes

Note: This post is over 3 months old and may be outdated or superseded by additional information.

tl;dr

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

Step 1: Navigate to the ZSH directory

cd ~/.oh-my-zsh

Step 2: Stash your local/untracked changes

git stash

Step 3: Run the automatic ZSH update

upgrade_oh_my_zsh

Step 4: Recover your changes

git stash pop