Brew update - detached HEAD

Hi. I tried updated homebrew and saw this message. Any suggestions to help address? Unsure what/how this happened as my only interaction w/ Homebrew has been updating/upgrading formulae lately.

~/homebrew on master+? ± brew update
error: The following untracked working tree files would be overwritten by checkout:
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/base.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/calculators/length.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/calculators/running_average.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/components.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/components/bar.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/components/percentage.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/components/rate.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/components/time.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/components/title.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/errors/invalid_progress_error.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/format.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/format/formatter.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/format/molecule.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/format/string.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/output.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/outputs/non_tty.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/outputs/null.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/outputs/tty.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/progress.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/throttle.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/time.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/timer.rb
	Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/version.rb
Please move or remove them before you switch branches.
Aborting
fatal: Could not detach HEAD
Already up-to-date.

I ran into a similar issue this morning. I was able to cd into /usr/local/homebrew and run git pull. It appears a number of changes were pulled down and this issue has disappeared. I haven’t dug into why it was occurring in the first place.

Try to run brew update-reset

6 Likes

Thank you @MikeMcQuaid That did the trick.