升级哦,我的Zsh给了我‘不是一个Git存储库’错误

ulydmbyx  于 2022-09-21  发布在  Git
关注(0)|答案(1)|浏览(464)

因为当我想要更新哦我的Zsh upgrade_oh_my_zsh时,我将我的OSX升级到El Capitan,我得到了以下错误:

Upgrading Oh My Zsh
fatal: Not a git repository (or any of the parent directories): .git
There was an error updating. Try again later?

我以前从来没有用过git,在互联网上搜索这个致命的错误,他们建议在/.oh-my-zsh文件夹中做git init。运行此命令后,当我尝试再次运行upgrade_oh_my_zsh时,出现新的致命错误。

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.

我不知道这是否与此有关,但当我打开终端(ITerm2)时,我也收到了这样的通知:

/Users/peter/.zshrc:1: command not found: Path

有谁有这方面的经验或知道我的问题的解决方案吗?

0lvr5msh

0lvr5msh1#

看起来你的垃圾回购被从哦-my-zsh上删除了?您可以通过运行以下命令重新添加遥控器并更新到最新版本的Zsh:

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

在此之后,重新启动您的终端示例,您应该就可以运行了。

相关问题