Mac使用brew安装Nginx,提示错误:homebrew-core is a shallow clone

  在Mac电脑终端使用命令brew install nginx或者brew update都报如下错误:

Error: 
  homebrew-core is a shallow clone.
  homebrew-cask is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
These commands may take a few minutes to run due to the large size of the repositories.
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!

  

  兜兜转转找了好多帖子,最后还是按照字面提示进行操作。分别执行如下两条命令。时间较长,耐心等待。

  为了避免意外,我是在 # cd /usr/local/Homebrew/目录下执行的操作命令。如果有小伙伴尝试在其他位置操作命令也可以得到正确结果的话,可以留言分享下结果。

# git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
# git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow

 

  

  mac 使用brew安装nginx 各种命令
  安装:brew install nginx      或者      sudo brew install nginx
  启动:brew services start nginx       或者         sudo brew services start nginx
  重启:brew services restart nginx        或者         sudo brew services restart nginx
  停止:brew services stop nginx           或者            sudo brew services stop nginx
  查看:cat usr/local/etc/nginx/nginx.conf
  编辑:vi usr/local/etc/nginx/nginx.conf
  查看安装目录:brew list nginx
 
  nginx -s reload:      修改配置后重新加载生效
  nginx -s stop :     快速停止
  nginx nginx -s quit:  完整有序的停止nginx
  nginx:         启动nginx

 

posted @ 2021-09-30 16:20  阿木工作室  阅读(1284)  评论(0编辑  收藏  举报