尝试通过Homebrew安装Hugo-“无法将HEAD解析为修订版”

我正在尝试使用 Hugo 尝试访问一个新站点,但在安装过程中被卡住了。我已经安装了 Homebrew,在运行该版本时,我得到以下信息:

~ % brew --version
Homebrew 2.7.2
Homebrew/homebrew-core (no git repository)
Homebrew/homebrew-cask (git revision b96680c; last commit 2021-01-07)

当我跑 brew install hugo

我得到以下信息:

~ % brew install hugo
fatal: Could not resolve HEAD to a revision
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula or cask with the name "hugo".
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.

我究竟做错了什么?这是第一次在 home-brew 中工作。


编辑:运行时brew install --verbose Hugo,我收到以下警告:

% brew install --verbose hugo

fatal: Could not resolve HEAD to a revision

==> Searching for similarly named formulae...

Error: No similarly named formulae found.

Error: No available formula or cask with the name "hugo".

==> Searching for a previously deleted formula (in the last month)...

Error: No previously deleted formula found.

==> Searching taps on GitHub...

/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/2.7.2 (Macintosh; Intel Mac OS X 11.1) curl/7.64.1 --header Accept-Language: en --retry 3 --location https://api.github.com/search/code?q=user%3AHomebrew+path%3AFormula+path%3ACasks+path%3A.+filename%3Ahugo+extension%3Arb&per_page=100 --header Accept: application/vnd.github.v3+json --write-out '
'%{http_code} --header Accept: application/vnd.github.antiope-preview+json --header Authorization: token ****** --dump-header /private/tmp/github_api_headers20210106-8376-1r02uaz

回答

git -C $(brew --repository homebrew/core) checkout master

或者

git -C $(brew --repository homebrew/core) reset --hard HEAD.

  • `git -C $(brew --repository homebrew/core) checkout master` worked for me as well.
  • "git -C $(brew --repository homebrew/core) checkout master"
    this command, and this command ONLY, worked for me in an ocean of different tries/SO answers.

以上是尝试通过Homebrew安装Hugo-“无法将HEAD解析为修订版”的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>