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

Use

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

or

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

As illustrated by this thread, this might be related to brew itself, not so much hugo.

brew install --verbose hugo

This should give you more and allow you to see at which step brew is stuck.

[where the error occurred], I changed into that directory to find that it was empty – all that was in the dir was a .git/ folder and nothing else.

So, to restore the missing contents, I used git fetch and git pull --rebase.


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

That points to a brew configuration issue, since there is a formulae for hugo

Packages are installed according to their formulae, which live in /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula

Check that Formula folder and see if hugo is missing there.
If not, at least try brew extract hugo inside a new tap.

brew tap-new gohugoio/hugo
brew extract --version 0.80.0 hugo gohugoio/hugo
brew install gohugoio/hugo/[email protected]

Tags:

Git

Homebrew

Hugo