Homebrew - How to upgrade a HEAD forumla?

I installed libimobiledevice a few months ago with brew install --HEAD libimobiledevice, and tried to upgrade it today with brew upgrade libimobiledevice (no --HEAD because it's not an option for brew(1)), and I got this:

Warning: libimobiledevice HEAD-<commit-hash> already installed
# No upgrade happened

I checked the source code repository and the commit hash was not up-to-date.

So how do I upgrade a HEAD formula like libimobiledevice?

Edit: the commit hash is 333eb1a, pointing to a commit in June 2020.


Solution 1:

It's --fetch-HEAD for upgrade command. Try:

brew upgrade libimobiledevice --fetch-HEAD