Oh-My-Zsh: Fix for parse error near elif

I am using Oh My Zsh in my multi terminal setup in Windows. I recently updated the Oh My Zsh and it immediately started throwing error 'parse error near elif'. I had enabled the git plugin for Oh My Zsh and it was not working because of this error.

It turns out that the (temporary) fix is very simple to solve this error:

Inside your Oh My Zsh terminal, run the following commands:

cd $ZSH
git config core.autocrlf false
git rm --cached -r .
git reset --hard

And restart your terminal. After that you should not see that error message again and everything should be back to normal.

Veerasundar profile photo

Written by Veerasundar

Veerasundar is a Software Engineer, currently working at Salesforce as a Lead Member of Technical Staff. He has over 16 years of industry experience, building consumer facing web applications. He lives in Chennai, India.

Contact Veerasundar: Email or Twitter