brew: git can't update paths and switch to branch at the same time during installation
While installing homebrew I got the following message:
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 3725, done.
remote: Compressing objects: 100% (3617/3617), done.
remote: Total 3725 (delta 15), reused 1250 (delta 0), pack-reused 0
Receiving objects: 100% (3725/3725), 2.91 MiB | 2.22 MiB/s, done.
Resolving deltas: 100% (15/15), done.
Checking connectivity... done.
Tapped 3604 formulae (3,752 files, 9M)
Checking out v1.0.0 in /usr/local/Homebrew...
To checkout master in /usr/local/Homebrew run:
'cd /usr/local/Homebrew && git checkout master
Checking out v1.0.0 in /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
To checkout master in /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core run:
'cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core && git checkout master
fatal: Cannot update paths and switch to branch 'v1.0.0' at the same time.
Did you intend to checkout 'refs/tags/1.0.0' which can not be resolved as commit?
fatal: Needed a single revision
invalid upstream refs/tags/1.0.0
Already up-to-date.
Everything seems to be working, though.
Is this behaviour kind of intended?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 24 (10 by maintainers)
Yep, exactly. Apologies folks: the messaging/versioning is confusing but we will fix it for the next release. If you are on 1.0.1 it will still say 1.0.0: sorry about that.
@dezon Glad it’s working. It seems the first time it’ll print some unhelpful messages but still update and the second time everything will be fine. Thanks all!
@MikeMcQuaid needed a version update in Library/Homebrew/brew.sh for MR #1060
I’ve tried all the things listed here and
brew --versionstill reports 1.0.0, even after doinggit checkout v1.0.1@MikeMcQuaid I got same error with 1.0, then run
brew updatemultiple times and got same errors (1.0.1 have already released). Then I trybrew update --forceandgit checkout 1.0.1.So now I have:
brew update->Already up-to-date.git status->On branch v1.0.1,brew update --force->Checking out v1.0.1 in /usr/local/Homebrew... To checkout v1.0.1 in /usr/local/Homebrew run: 'cd /usr/local/Homebrew && git checkout v1.0.1 Already up-to-date.brew --version->Homebrew 1.0.0 (git revision a381b; last commit 2016-09-21) Homebrew/homebrew-core (git revision 6e220; last commit 2016-09-21)I just report, this isn’t a problem, big thanks for 1.0.Yep, basically it’ll complain the first time as it tries to look for a tag on all repositories and then afterwards it’ll be all 🆗. The weird complaints the first time will not cause any issues beyond 😕 people.
@omtcyfz You can either
git checkout v1.0.1or just leavebrew updateand it’ll handle it correctly either way.@dezon Run
brew update --forcemultiple times (like 4-5x) and see if if it eventually works.@MikeMcQuaid
brew update(two) andbrew update --forceit’s not workI’ve tagged 1.0.1 which should address this with a
brew update(or two). Please let me know in here if it takes two or if that still isn’t enough (in which case trybrew update --forceand then post in here).@MikeMcQuaid The fix provided in the
Readme.mdseems to have cleared things up for me, with git reportingv1.0.0at the end of that process.brew updateandbrew update --forceboth still fail.brew updatestill produces the same output as my first comment here, whilebrew update --forceproduces six copies of it, one for each tap (homebrew-cask,homebrew-core, etc.).@MikeMcQuaid Installation now gives
Is this
Intended, by the way?
Thanks for the report! Can you both try
brew update, see if that fixes it and if not runbrew updateagain, see if that fixes it and if not runbrew update --forceand see if that fixes it and then post in this issue with what commands you had to run to get this to work. Thanks!