I have a script I use for maintaining by Homebrew installation containing the line
brew --config && echo; brew update && echo; brew upgrade && brew list && echo; brew leaves && echo; brew cask list && echo;
and running (typically) in ~
. Occasionally when I run this script I get output that includes
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
followed by
Error: Another active Homebrew update process is already in progress.
Please wait for it to finish or terminate it to continue.
How do I prevent this from happening?
From reading the suggested help, I expect that running something like git gc --auto --aggressive &&
explicitly first would work, but it's unclear to me how to aim it at the right repo. Or is the cause something else entirely?