Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

git - Trying to install Hugo via Homebrew - "Could Not Resolve HEAD to a Revision"

I'm trying to take a stab at a new site using Hugo, and I am stuck during installation. I've installed Homebrew and when running the version, I get the following:

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

And when I run brew install hugo

I get the following:

~ % 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.

What am I doing wrong? This is the first time working in home-brew.


Edit: when running brew install --verbose Hugo, I get the following warnings:

% 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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

use

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

or

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...