sqitchers / homebrew-sqitch

Homebrew Formulas for Sqitch
22 stars 10 forks source link

brew update leads to missing ref #48

Closed unitof closed 4 years ago

unitof commented 4 years ago

Recently running brew update started causing the following error:

fatal: couldn't find remote ref refs/heads/master
Error: Fetching /usr/local/Homebrew/Library/Taps/sqitchers/homebrew-sqitch failed!

I figured out why and am posting the solution to help others:

Sqitch recently renamed the master branch to main (884225792358f42da8feb13d35980c697af07335). Homebrew relies on local Git origin settings for each tap so it's still looking for the old branch on origin.

Just run:

brew untap sqitchers/sqitch && brew tap sqitchers/sqitch

and you'll be good to go!

Note that untapping does not uninstall or erase any Sqitch settings, just refreshes the Homebrew tap. I could only see this causing an issue if you've been doing local edits in /usr/local/Homebrew/Library/Taps/sqitchers/homebrew-sqitch, in which case you could manually edit .git/config to reflect the new origin:main branch.

unitof commented 4 years ago

Sqitch crew: it may be helpful if, like Twilio after also renaming, you added a Warning to Homebrew to alert users what they need to do.

I…have no idea how you do that but I'm sure you'll figure it out!

image
unitof commented 4 years ago

@theory Found out how you do it! You'd have to (temporarily) recreate the master branch with something like this: https://github.com/twilio/homebrew-brew/commit/01eab759195891101f11497b6af7fe074abba79b

theory commented 4 years ago

Good call, thanks @unitof.

altfatterz commented 3 years ago
brew tap --repair