Upgrading Oh My Zsh gives me 'not a git repository' error

Looks like your git repo was removed from oh-my-zsh? You can re-add the remote and update to the latest version of Zsh by running:

cd ~/.oh-my-zsh
git init # you've already done this step, so you can skip
git remote add origin https://github.com/robbyrussell/oh-my-zsh.git
git fetch
git reset --hard origin/master

After that, restart your terminal instance and you should be good to go.

enter image description here


I just encountered that message. In my case (on a Mac) it just so happens that I just installed Xcode, and that git stopped working until I accepted its terms and conditions. Just in case...


The above solution didn't work for me. The problem in my case was that I have an alias

alias gpucb="git pull origin $(git branch --show-current)"

As soon as I commented it the error was gone. I need a fix for this. Also, the weird part is that the error is encountered only in the second git command.

Tags:

Git

Oh My Zsh