Since I upgrade my OSX to El Capitan when I want to update Oh My Zsh upgrade_oh_my_zsh
I got the following error:
Upgrading Oh My Zsh
fatal: Not a git repository (or any of the parent directories): .git
There was an error updating. Try again later?
I never used git before, searching this fatal error on the internet they advice to do git init
in the /.oh-my-zsh
folder. After running this command a new fatal error occur when I try to run upgrade_oh_my_zsh
again.
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I don't know if it has anything to do with with it but when I open the terminal (iTerm2) I also got this notification:
/Users/peter/.zshrc:1: command not found: Path
Anyone has experience with this or knows a solution for my problem?
The “not a git repository” error is common. The cause is running a Git command in the wrong folder or running a Git command before initializing a Git repository. Now you're ready to solve the “not a git repository” error like an expert developer!
To do so, you need to navigate to the correct folder and then run the command git init , which will create a new empty Git repository or reinitialize an existing one.
git-prompt.sh is compatible with both Bash and Zsh. Zsh is powerful enough that there are entire frameworks dedicated to making it better.
To manually update ohmyzsh, you can run the "omz" update command and just like that you will get the latest version of ohmyzsh.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With