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)

Commits related to this issue

Most upvoted comments

@MikeMcQuaid needed a version update in Library/Homebrew/brew.sh for MR #1060

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 --version still reports 1.0.0, even after doing git checkout v1.0.1

@MikeMcQuaid I got same error with 1.0, then run brew update multiple times and got same errors (1.0.1 have already released). Then I try brew update --force and git 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.1 or just leave brew update and it’ll handle it correctly either way.

@dezon Run brew update --force multiple times (like 4-5x) and see if if it eventually works.

@MikeMcQuaid brew update (two) and brew update --force it’s not work

brew update
Checking out v1.0.0 in /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask...
To checkout master in /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask run:
  'cd /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask && 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
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.
➜  local brew --version
Homebrew 1.0.0 (git revision a381b; last commit 2016-09-21)
Homebrew/homebrew-core (git revision 0fad; last commit 2016-09-21)

I’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 try brew update --force and then post in here).

@MikeMcQuaid The fix provided in the Readme.md seems to have cleared things up for me, with git reporting v1.0.0 at the end of that process.

brew update and brew update --force both still fail. brew update still produces the same output as my first comment here, while brew update --force produces six copies of it, one for each tap (homebrew-cask, homebrew-core, etc.).

@MikeMcQuaid Installation now gives

==> Tapping homebrew/core
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.11 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
Already up-to-date.

Is this

To checkout master in /usr/local/Homebrew run:
  'cd /usr/local/Homebrew && git checkout master

Intended, by the way?

Thanks for the report! Can you both try brew update, see if that fixes it and if not run brew update again, see if that fixes it and if not run brew update --force and see if that fixes it and then post in this issue with what commands you had to run to get this to work. Thanks!