If Homebrew was updated on Aug 10-11th 2016 and brew update always says Already up-to-date. you need to run: cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew update.
brew update and retried your prior step?brew doctor, fixed as many issues as possible and retried your prior step?sudo chown -R $(whoami) $(brew --prefix)?kind of regression bug for me :-(
Since a certain brew version, don't remember which one (AFAIR the version claiming root can own /usr/local/ again) i had troubles
$ brew update
fatal: Cannot update paths and switch to branch 'stable' at the same time.
Did you intend to checkout 'refs/tags/1.0.8' which can not be resolved as commit?
fatal: Needed a single revision
invalid upstream refs/tags/1.0.8
Already up-to-date.
before it was same message with version 1.0.9 .. I had a tag 1.0.9 in refs/tags/.I issued a git reset --hard to overwrite local version and it was ok . But now this bug comes back somehow ?
I do not make local changes to homebrew or whatever. I don't understand what's happening.
I also enable debugging see attached file
thanks for your help
forget to say that of course all brew commands are impacted
$ brew install npm --with-openssl
fatal: Cannot update paths and switch to branch 'stable' at the same time.
Did you intend to checkout 'refs/tags/1.0.8' which can not be resolved as commit?
fatal: Needed a single revision
invalid upstream refs/tags/1.0.8
==> Installing dependencies for node: openssl
==> Installing node dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2j.el_capitan.bottle.tar.gz
########################
Try to run cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew update
this is what I'm doing each time an issue like this happens. The question is now why this happens again after a few brew update went ok?
This will solved the issue now but I'm sure it will happen again in some weeks, since this is the third time I have to fix it.. as far as i can remember I did not had such issues in the past (with legacy-homebrew?) . Do you have any explanation? Did i do something wrong ?
What does cd "$(brew --repo)" && git tag --list output?
Closing due to no response. Will continue to answer questions, though.
Sorry was not available .
output from command as expected when it runs smoothly
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.7.1
0.8
0.8.1
0.9
0.9.1
0.9.2
0.9.3
0.9.4
0.9.5
0.9.8
0.9.9
1.0.0
1.0.1
1.0.2
1.0.3
1.0.4
1.0.5
1.0.6
1.0.7
1.0.8
1.0.9
But now new tag new problem, I get same issue with brew update
$ brew update
fatal: Cannot update paths and switch to branch 'stable' at the same time.
Did you intend to checkout 'refs/tags/1.1.0' which can not be resolved as commit?
fatal: Needed a single revision
invalid upstream refs/tags/1.1.0
Updated 11 taps
<...skipped...>
What's your output after that from git tag --list? Does it include 1.1.0? Please paste your brew config and brew doctor output, thanks!
yep now 1.1.0 is included also after brew update.
next my brew config output 馃憤
HOMEBREW_VERSION: 1.0.9-41-g0028cf9
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 0028cf9fb85e7fecb4ad803a817600068c821dc9
Last commit: 11 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: cd29b4623425ae102c63ccac223de383947837f0
Core tap last commit: 13 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.0.0-p648
GCC-4.2: build 5666
Clang: 8.0 build 800
Git: 2.10.2 => /usr/local/bin/git
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.8.0_102, 1.8.0_74, 1.7.0_79
macOS: 10.11.6-x86_64
Xcode: 8.0
CLT: 7.3.1.0.1.1461711523
X11: 2.7.9 => /opt/X11
Ok, looks fixed. Post here again if it happens again. Thanks!
I'm seeing this on one of my boxes too. I've previously had this problem, and temporarily fixed it with cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew update but it comes back.
camdennarzt@WALLE:~ $ brew update
fatal: Cannot update paths and switch to branch 'stable' at the same time.
Did you intend to checkout 'refs/tags/1.1.1' which can not be resolved as commit?
fatal: Needed a single revision
invalid upstream refs/tags/1.1.1
Already up-to-date.
camdennarzt@WALLE:~ $ brew config
HOMEBREW_VERSION: 1.1.0-84-g82aace9
ORIGIN: https://github.com/Homebrew/brew
HEAD: 82aace9844ca8323b1eabc9446e884bd933f3c42
Last commit: 12 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: fa0bfe1444e54f07f0632e4fcc2d457cc004e8da
Core tap last commit: 4 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: dual-core 64-bit penryn
Homebrew Ruby: 2.0.0-p648
Clang: 8.0 build 800
Git: 2.9.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: N/A
macOS: 10.11.6-x86_64
Xcode: 8.1
CLT: 7.3.1.0.1.1461711523
X11: 2.7.11 => /opt/X11
camdennarzt@WALLE:~ $ brew doctor
Your system is ready to brew.
camdennarzt@WALLE:~ $ cd "$(brew --repo)" && git tag --list
/usr/local/Homebrew ~
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.7.1
0.8
0.8.1
0.9
0.9.1
0.9.2
0.9.3
0.9.4
0.9.5
0.9.8
0.9.9
1.0.0
1.0.1
1.0.2
1.0.3
1.0.4
1.0.5
1.0.6
1.0.7
1.0.8
1.0.9
1.1.0
1.1.1
I'm seeing this on one of my boxes too.
This was a brew update bug that affected you if you updated in a certain window. We cannot fix the old version of brew update so there's nothing else we can do except post the workaround.
Sorry, I mustn't be understanding you properly, why did the problem come back today if the brew update bug is fixed? And the tag the error refers to is in the list...
@CamJN You were "stuck" on an old branch/tag.
I completely agree with @CamJN because since El Capitan on this MBP each new tag creates such an update message .. For me applying the workaround only solves the issue til the next tag .. Somehow weird .. But many thanks for your help
I found some clues .. I should have began with that
here some status info
$ git branch -av
master 0f975ce Merge pull request #1066 from maxim-belkin/readall-fix
v1.0.1 bbed724 Merge pull request #1078 from ilovezfs/cmake-weak-symbols
* v1.0.6 0c82cce LICENSE: use more standard BSD 2-Clause text.
remotes/origin/cask/bump-rubocop-cask 2674bfa hbc/cli/style: bump RUBOCOP_CASK_VERSION
remotes/origin/gh-pages 3fd8a47 Add link to Formula on marketing page
remotes/origin/go 9e8ffa9 Only use curl -k on Leopard
remotes/origin/master 0c82cce LICENSE: use more standard BSD 2-Clause text.
remotes/origin/revert-1567-fix-diagnostic-conditonal bea5fe6 Revert "Fix early exit condition for check_for_member_of_admin_group"
remotes/origin/superwip 464ec92 superwip
really weird ..
and here the remote
origin https://github.com/Homebrew/brew.git (fetch)
origin https://github.com/Homebrew/brew.git (push)
seems ok but
$ git status
On branch v1.0.6
nothing to commit, working tree clean`
$ brew --version
Homebrew 1.1.2-2-g0c82cce
Homebrew/homebrew-core (git revision c5f43; last commit 2016-12-01)
so really strange I'm missing the branch stable !! this branch is the one I have on another machine which seems to work ok
How to repair this mess without losing the installed software ?
How to repair this mess without losing the installed software ?
git checkout master; git branch --delete v1.0.1 v1.0.6; brew update --force
this is exactly what I have done with -D instead of --delete because git claimed that those 2 branches were not fully merged. The --force update put me on tag v1.1.2 branch . Is this correct ? or will the next brew update again break the stability ?
You should be on a branch named stable or a branch named master. If not, run git branch -D v1.1.2; git fetch; git checkout master; git reset --hard origin/master; brew update --force. If you're still on the wrong branch after that: paste your brew config output in here.
It seems that the brew update --force operates strangely on my config. This is the point I'm somehow not able to switch to stable ..
I manage to get back on master
$ brew update --force
fatal: Cannot update paths and switch to branch 'stable' at the same time.
Did you intend to checkout 'refs/tags/1.1.2' which can not be resolved as commit?
fatal: Needed a single revision
invalid upstream refs/tags/1.1.2
Already up-to-date.
after that still on master .. BUT this is something I don't understand
$ brew --version
Homebrew 1.1.2-3-g8f82e89
Homebrew/homebrew-core (git revision ef76b; last commit 2016-12-01)
here the config
HOMEBREW_VERSION: 1.1.2-3-g8f82e89
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 8f82e89d0b26108e32a10b5d95b67e5e21ff0df6
Last commit: 16 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: ef76b735dc54b6c74cc4f41f94827cae4428cb4d
Core tap last commit: 8 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.0.0-p648
GCC-4.2: build 5666
Clang: 8.0 build 800
Git: 2.10.2 => /usr/local/bin/git
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.8.0_102, 1.8.0_74, 1.7.0_79
macOS: 10.11.6-x86_64
Xcode: 8.1
CLT: 7.3.1.0.1.1461711523
X11: 2.7.9 => /opt/X11
At this point I'd probably recommend doing rm -rf /usr/local/Homebrew/.git and rerunning brew update.
Did you intend to checkout 'refs/tags/1.1.2' which can not be resolved as commit?
Can I see the output of git tag --list and also your ~/.gitconfig?
$ git tag --list
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.7.1
0.8
0.8.1
0.9
0.9.1
0.9.2
0.9.3
0.9.4
0.9.5
0.9.8
0.9.9
1.0.0
1.0.1
1.0.2
1.0.3
1.0.4
1.0.5
1.0.6
1.0.7
1.0.8
1.0.9
1.1.0
1.1.1
1.1.2
Concerning git config (of course 'curated')
core.autocrlf=input
core.safecrlf=true
merge.tool=opendiff
color.ui=auto
pack.threads=0
push.default=simple
mergetool.sourcetree.trustexitcode=true
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=false
core.autocrlf=false
remote.origin.url=https://github.com/Homebrew/brew.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
homebrew.analyticsmessage=true
homebrew.analyticsuuid=18A486A2-2B29-4300-B813-28D6BC9A1597
Really interesting after completely removing .git in directory brew --repo
$ brew update
Initialized empty Git repository in /usr/local/Homebrew/.git/
remote: Counting objects: 1036, done.
remote: Compressing objects: 100% (946/946), done.
remote: Total 1036 (delta 101), reused 378 (delta 52), pack-reused 0
Receiving objects: 100% (1036/1036), 1.00 MiB | 1.70 MiB/s, done.
Resolving deltas: 100% (101/101), done.
From https://github.com/Homebrew/brew
* [new branch] master -> origin/master
HEAD is now at 8f82e89 README: update license name.
fatal: Cannot update paths and switch to branch 'stable' at the same time.
Did you intend to checkout 'refs/tags/1.1.2' which can not be resolved as commit?
fatal: Needed a single revision
invalid upstream refs/tags/1.1.2
==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
https://git.io/brew-analytics
Already up-to-date.
and
$brew --version
Homebrew >1.1.0 (no git repository)
Homebrew/homebrew-core (git revision ef76b; last commit 2016-12-01)
tag list identical as before
What does /usr/local/bin/git rev-parse refs/tags/1.1.2 and /usr/bin/git rev-parse refs/tags/1.1.2 output?
0f529dae1043639058130092cf35e68d18907cb8 but what is the diff between commands ?
Same with both? Difference is there's something weird going on with your Git. What does git checkout --force -B stable refs/tags/1.1.2 output?
And also what does ls -lha stable refs/tags output?
oups haven't see the filepath before . yep both are identical
out from git checkout .. on branch stable
but brew update same message as usual .. FS is case sensitive I assume not an issue .. ?
Please provide the full output of all the commands requested so I can help.
checkout --force -B stable refs/tags/1.1.2 -> Switched to a new branch 'stable'
ls -lha stable refs/tags has output
drwxr-xr-x 2 aUsrj admin 1.1K 2 Dec 09:25 ./
drwxr-xr-x 5 aUsrj admin 170B 2 Dec 09:25 ../
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 0.1
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 0.2
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 0.3
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 0.4
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 0.5
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 0.6
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 0.7
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 0.7.1
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 0.8
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 0.8.1
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 0.9
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 0.9.1
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 0.9.2
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 0.9.3
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 0.9.4
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 0.9.5
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 0.9.8
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 0.9.9
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 1.0.0
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 1.0.1
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 1.0.2
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 1.0.3
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 1.0.4
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 1.0.5
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 1.0.6
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 1.0.7
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 1.0.8
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 1.0.9
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 1.1.0
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 1.1.1
-rw-r--r-- 1 aUsrj admin 41B 2 Dec 09:25 1.1.2
the rev-parse you already have
the rev-parse you already have
Was the output identical for both invocations?
ls -lha stable refs/tags
Just to confirm: is that in /usr/local/Homebrew/.git/refs/tags or /usr/local/Homebrew/refs/tags?
yeah output identical and the former /usr/local/Homebrew/.git/refs/tags
Ok, so /usr/local/Homebrew/refs/tags doesn't exist? If so, I have no idea what to do now, sorry. It could be related to case-sensitivity.
nope doesn鈥檛 exist . But it doesn't exist neither on my other MBP so surely not the problem .. The diff between both systems is the case-sensitivity of the FS but i cannot imagine this should an issue otherwise i would have some doubt about the nextgen brew ;-)
but anyway thanks for your help
i cannot imagine this should an issue otherwise i would have some doubt about the nextgen brew ;-)
We don't do any testing or CI on case-sensitive filesystems so, although I also doubt it's an issue, they do seem correlated to me.
perhaps as an OS X package manager, it would interesting to perform some CI and testing on case-sensitive FS since some of us are only using cs FS ..
@m0ll3art Alternatively, perhaps as an OS X user it would be sensible to use the default filesystem configuration 馃槈. We'd consider doing testing and CI if we had unlimited funds and time but sadly we have very limited of both 馃槶
@MikeMcQuaid perhaps this article Linus Torvalds: Apple's HFS+ is probably the worst file system ever | CIO may help why I dislike HFS+ case-insensitivity and not mentioning security issues. But thanks for your advice
since problems are expected
We don't expect problems but, like everything brew doctor warns you about, there may be problems. In this case there's an issue that seems specific to you and your machine that could be related to case-sensitivity, Git configuration or something else. My guess was case-sensitivity but I don't know for sure and unfortunately I can't justify spending any more time on an issue that appears to be specific to a single user's machine.
For me case-sensitive should be the default FS and not the case-insensitive one
That's up to you but ultimately we defer to Apple's defaults and that's what we support because that's what 99% of people use. Again, you can use what you want but we may be unable to help debug issues. If you can figure them out yourself and submit fixes (not just warnings) we'll consider merging them. If you can't figure them out yourself I might make a gentle suggestion that you'd be better off using the defaults.
that's what we support because that's what 99% of people use.
99% of the Mac Users are using case-insensitive FS .. This is a revelation to me and I feel so stupid now to belong to this 1% of the user using case-sensitive FS on my Mac. Of course you've done your fact checking .. Perhaps this would be worth a tweet ? The lead maintainer of Homebrew claims that 99% of the people are using HFS+ case-insensitive FS .. Hope @mxcl agreed with such a statement and also how you handled this issue ..
Thanks @MikeMcQuaid for your strong remarks and facilitating the discussion. I quit homebrew since I only represent 1% of 1% of the users and you will not be able to help me.
but we may be unable to help debug issues.
Please do not change anything so great .. sorry but I'm pi.. off
99% of the Mac Users are using case-insensitive FS .. This is a revelation to me and I feel so stupid now to belong to this 1% of the user using case-sensitive FS on my Mac. Of course you've done your fact checking .. Perhaps this would be worth a tweet ? The lead maintainer of Homebrew claims that 99% of the people are using HFS+ case-insensitive FS
It's the default on macOS. Most users use the defaults (that applies to most software, too). brew doctor warns on output and I've read many thousands of brew doctors and very, very few have people using a case-sensitive OS.
Hope
@mxclagreed with such a statement and also how you handled this issue ..
I'm the lead maintainer of this project and I know @mxcl in person and he'd very likely agree with me that focusing on the 99% case is a better use of the project's time.
I quit homebrew since I only represent 1% of 1% of the users and you will not be able to help me.
I hope whatever you use instead works better for you, genuinely.
Please do not change anything so great .. sorry but I'm pi.. off
I'm sorry that it's frustrating but I you may need to appreciate a few things:
This stackoverflow post suggests creating a case-sensitive sparsebundle disk image for debugging case-sensitive issues with git. @m0ll3art if you can reproduce your error in this type of disk image and post instructions, then I'll try to reproduce it.
@MikeMcQuaid thanks for all you do for homebrew! Enjoy your vacation!
I have a normal case insensitive FS and the problem has returned with the new 1.1.3 tag. /usr/local/Homebrew/refs doesn't exist neither does /usr/local/Homebrew/stable (though /usr/local/Homebrew/.git/refs/tags does exist).
camdennarzt@WALLE:/usr/local/Homebrew [stable L|鉁擼 $ brew update
fatal: Cannot update paths and switch to branch 'stable' at the same time.
Did you intend to checkout 'refs/tags/1.1.3' which can not be resolved as commit?
fatal: Needed a single revision
invalid upstream refs/tags/1.1.3
Updated 1 tap (homebrew/core).
==> Updated Formulae
collectd gammu github-keygen haskell-stack kubernetes-cli minio ponyc sagittarius-scheme telegraf urbit
camdennarzt@WALLE:/usr/local/Homebrew [stable L|鉁擼 $ git tag --list
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.7.1
0.8
0.8.1
0.9
0.9.1
0.9.2
0.9.3
0.9.4
0.9.5
0.9.8
0.9.9
1.0.0
1.0.1
1.0.2
1.0.3
1.0.4
1.0.5
1.0.6
1.0.7
1.0.8
1.0.9
1.1.0
1.1.1
1.1.2
1.1.3
camdennarzt@WALLE:/usr/local/Homebrew [stable L|鉁擼 $ git branch -av
master f8aa057 Merge pull request #1561 from tsekityam/patch-2
* stable 0f529da Merge pull request #1573 from sorin-ionescu/fix-xcode-version-comparison
remotes/origin/master 6b4de31 Merge pull request #1661 from radex/patch-1
camdennarzt@WALLE:/usr/local/Homebrew [stable L|鉁擼 $ git checkout --force -B stable refs/tags/1.1.3
Reset branch 'stable'
camdennarzt@WALLE:/usr/local/Homebrew [stable L|鉁擼 $ git branch -av
master f8aa057 Merge pull request #1561 from tsekityam/patch-2
* stable 6b4de31 Merge pull request #1661 from radex/patch-1
remotes/origin/master 6b4de31 Merge pull request #1661 from radex/patch-1
camdennarzt@WALLE:/usr/local/Homebrew [stable L|鉁擼 $ git rev-parse refs/tags/1.1.3 && git rev-parse refs/tags/1.1.3
6b4de315046a8e4d8b8b70418f7ccd15fecb7801
6b4de315046a8e4d8b8b70418f7ccd15fecb7801
camdennarzt@WALLE:/usr/local/Homebrew [stable L|鉁擼 $ brew --version
Homebrew 1.1.3
Homebrew/homebrew-core (git revision 8366; last commit 2016-12-13)
camdennarzt@WALLE:/usr/local/Homebrew [stable L|鉁擼 $ git status
On branch stable
nothing to commit, working tree clean
camdennarzt@WALLE:/usr/local/Homebrew [stable L|鉁擼 $ cat ~/.gitconfig
[user]
name = Camden Narzt
email = [email protected]
[core]
editor = emacs
filemode = false
autocrlf = input
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
smtpuser =
smtppass =
smtpserverport = 587
[color]
ui = auto
[color "branch"]
current = yellow bold
local = green bold
remote = cyan bold
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
[color "status"]
added = green bold
changed = yellow bold
untracked = red bold
[alias]
history = log --oneline --abbrev-commit --all --graph --decorate --color
lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
[filter "media"]
required = true
clean = git media clean %f
smudge = git media smudge %f
[push]
default = simple
[filter "hawser"]
clean = git hawser clean %f
smudge = git hawser smudge %f
required = true
[filter "lfs"]
clean = git lfs clean %f
smudge = git lfs smudge %f
required = true
New 1.1.4 tag, new opportunity to gather info for this issue:
camdennarzt@WALLE:/usr/local/Homebrew [stable L|鉁擼 $ brew update
fatal: Cannot update paths and switch to branch 'stable' at the same time.
Did you intend to checkout 'refs/tags/1.1.4' which can not be resolved as commit?
fatal: Needed a single revision
invalid upstream refs/tags/1.1.4
Already up-to-date.
camdennarzt@WALLE:/usr/local/Homebrew [stable L|鉁擼 $ git tag --list
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.7.1
0.8
0.8.1
0.9
0.9.1
0.9.2
0.9.3
0.9.4
0.9.5
0.9.8
0.9.9
1.0.0
1.0.1
1.0.2
1.0.3
1.0.4
1.0.5
1.0.6
1.0.7
1.0.8
1.0.9
1.1.0
1.1.1
1.1.2
1.1.3
1.1.4
camdennarzt@WALLE:/usr/local/Homebrew [stable L|鉁擼 $ git branch -av
master f8aa057 Merge pull request #1561 from tsekityam/patch-2
* stable 6b4de31 Merge pull request #1661 from radex/patch-1
remotes/origin/master 9cd5a21 Merge pull request #1669 from vladshablinsky/fix_method_deprecated
remotes/origin/revert-1592-runtime_dependencies 862c3ba Revert "formula: runtime deps of build deps aren't runtime"
camdennarzt@WALLE:/usr/local/Homebrew [stable L|鉁擼 $ git rev-parse refs/tags/1.1.4 && git rev-parse refs/tags/1.1.4
99f42146c06333f820f45ed1940c5487990e2b31
99f42146c06333f820f45ed1940c5487990e2b31
camdennarzt@WALLE:/usr/local/Homebrew [stable L|鉁擼 $ brew --version
Homebrew 1.1.3
Homebrew/homebrew-core (git revision 33da; last commit 2016-12-14)
camdennarzt@WALLE:/usr/local/Homebrew [stable L|鉁擼 $ git status
On branch stable
nothing to commit, working tree clean
I'm going to hold off running git checkout --force -B stable refs/tags/1.1.4 just in case there is more info that I can provide.
I've been watching this thread for a while now. I'm on a default FS as well and have been seeing the same issue. I thought i'd try fixing it by completely uninstalling and reinstalling brew, but a few days after reinstall i'm getting the fatal error with the new 1.1.4 tag as well.
so i confirmed
``` * [new tag] 1.1.3 -> 1.1.3
installation a new completely new system case INSENSITIVE FS.. no further comment from my side
@m0ll3art As I said before:
I realise you're frustrated and I did not say above it definitely was the case sensitive filesystem causing this but just that your unsupported configuration caused me to deprioritise this.
Can you confirm what had been done/configured on the completely new system before installing Homebrew?
@m0ll3art @CamJN and @9130khz: can I see your brew config, brew doctor and the full contents (bar any secrets) of your ~/.gitconfig files, env | grep -I git and alias | grep -I git output on any affected systems.
@MikeMcQuaid sure thing:
camdennarzt@WALLE:~ $ brew config
HOMEBREW_VERSION: 1.1.3
ORIGIN: https://github.com/Homebrew/brew
HEAD: 6b4de315046a8e4d8b8b70418f7ccd15fecb7801
Last commit: 5 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 33dad5985f2145ce8d890db5c31932c1720bb606
Core tap last commit: 5 days ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: dual-core 64-bit penryn
Homebrew Ruby: 2.0.0-p648
Clang: 8.0 build 800
Git: 2.10.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /Volumes/Users/CamdenNarzt/.rbenv/shims/ruby => /Volumes/Users/CamdenNarzt/.rbenv/versions/2.3.3/bin/ruby
Java: N/A
macOS: 10.11.6-x86_64
Xcode: 8.2
CLT: 8.2.0.0.1.1480973914
X11: 2.7.11 => /opt/X11
camdennarzt@WALLE:~ $ brew doctor
Your system is ready to brew.
camdennarzt@WALLE:~ $ env | grep -I git
camdennarzt@WALLE:~ $ alias | grep -I git
alias add='git add'
alias status='git status'
camdennarzt@WALLE:~ $ cat ~/.gitconfig
[user]
name = Camden Narzt
email = [email protected]
[core]
editor = emacs
filemode = false
autocrlf = input
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
smtpuser =
smtppass =
smtpserverport = 587
[color]
ui = auto
[color "branch"]
current = yellow bold
local = green bold
remote = cyan bold
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
[color "status"]
added = green bold
changed = yellow bold
untracked = red bold
[alias]
history = log --oneline --abbrev-commit --all --graph --decorate --color
lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
[filter "media"]
required = true
clean = git media clean %f
smudge = git media smudge %f
[push]
default = simple
[filter "hawser"]
clean = git hawser clean %f
smudge = git hawser smudge %f
required = true
[filter "lfs"]
clean = git lfs clean %f
smudge = git lfs smudge %f
required = true
@CamJN Great, thanks. Can you see if the issue goes away if you either:
~/.gitconfig to ~/.gitconfig.oldbrew install gitbrew update for either? Thanks! Also, what directory do you run these commands in, randomly, and what's the contents? Thanks!
Sadly neither mv ~/.gitconfig{,.old} nor brew install git fixed it, still get:
fatal: Cannot update paths and switch to branch 'stable' at the same time.
Did you intend to checkout 'refs/tags/1.1.5' which can not be resolved as commit?
fatal: Needed a single revision
invalid upstream refs/tags/1.1.5
@CamJN Thanks for trying anyway. Directory contents?
/usr/local contains these directories: Cellar, Frameworks, Homebrew, bin, etc, include, lib, opt, sbin, share, var
If you want a full recursive listing I'll have to put that in a gist, but I'm happy to do so.
Are you running it inside /usr/local itself or /usr/local/Homebrew or someone else? Can you confirm if /usr/local/.git exists by any chance?
/usr/local/.git does not exist. I ran all the commands from my home dir, if that's what you mean. So here's the contents of that too:
-rwx------@ 1 camdennarzt staff 34K 6 Dec 09:44 .DS_Store
drwxrwxrwx 4 camdennarzt staff 136B 14 Dec 2013 .MakeMKV
drwx------ 2 camdennarzt staff 68B 21 Aug 2015 .PKInstallSandboxManager-SystemSoftware
drwxrwxrwx@ 3 camdennarzt staff 102B 9 Jun 2016 .TemporaryItems
drwx------ 2 camdennarzt staff 68B 16 Dec 08:45 .Trash
-rw------- 1 camdennarzt staff 215B 1 Nov 21:35 .Xauthority
-rw-r--r-- 1 camdennarzt staff 1B 18 Dec 14:14 .archey-ip
lrwxr-xr-x 1 camdennarzt staff 61B 17 Oct 2014 .bash.d -> /Volumes/Users/CamdenNarzt/Programming/Bash/dot-files/.bash.d
-rw------- 1 camdennarzt staff 23M 20 Jul 2015 .bash_history
lrwxr-xr-x 1 camdennarzt staff 67B 17 Oct 2014 .bash_profile -> /Volumes/Users/CamdenNarzt/Programming/Bash/dot-files/.bash_profile
drwxr-xr-x 8 camdennarzt staff 272B 16 Dec 08:45 .bash_sessions
lrwxr-xr-x 1 camdennarzt staff 61B 17 Oct 2014 .bashrc -> /Volumes/Users/CamdenNarzt/Programming/Bash/dot-files/.bashrc
drwxr-xr-x 3 camdennarzt staff 102B 31 Oct 15:30 .bundle
drwx------ 4 camdennarzt staff 136B 10 Oct 2012 .cache
lrwxr-xr-x 1 camdennarzt staff 63B 17 Oct 2014 .calendar -> /Volumes/Users/CamdenNarzt/Programming/Bash/dot-files/.calendar
drwx------ 7 camdennarzt staff 238B 14 Mar 2015 .config
drwx------ 8 camdennarzt staff 272B 22 Oct 2011 .cpan
drwx------ 3 camdennarzt staff 102B 4 Jul 2012 .cups
lrwxr-xr-x 1 camdennarzt staff 62B 17 Oct 2014 .emacs.d -> /Volumes/Users/CamdenNarzt/Programming/Bash/dot-files/.emacs.d
drwx------ 30 camdennarzt staff 1.0K 30 Jul 2014 .fontconfig
drwxr-xr-x 4 camdennarzt staff 136B 22 Mar 2014 .gem
lrwxr-xr-x 1 camdennarzt staff 64B 17 Oct 2014 .gitconfig.old -> /Volumes/Users/CamdenNarzt/Programming/Bash/dot-files/.gitconfig
drwx------ 2 camdennarzt staff 68B 7 Feb 2013 .gnome2
-rw-r----- 1 camdennarzt staff 250B 17 Jan 2016 .influx_history
drwx------ 9 camdennarzt staff 306B 10 Nov 2012 .inkscape-etc
lrwxr-xr-x 1 camdennarzt staff 62B 17 Oct 2014 .inputrc -> /Volumes/Users/CamdenNarzt/Programming/Bash/dot-files/.inputrc
-rw------- 1 camdennarzt staff 440B 18 Oct 2014 .lesshst
drwx------ 2 camdennarzt staff 68B 15 Oct 2015 .lldb
drwx------ 3 camdennarzt staff 102B 28 Aug 2012 .local
-rw------- 1 camdennarzt staff 82K 9 Feb 2016 .mysql_history
drwxr-xr-x 63 camdennarzt staff 2.1K 14 Mar 2015 .npm
drwxr-xr-x 4 camdennarzt staff 136B 16 Jan 2016 .oracle_jre_usage
-rw-r--r-- 1 camdennarzt staff 65B 18 Dec 14:24 .passenger-enterprise-download-token
-rw------- 1 camdennarzt staff 4.5K 23 Oct 2013 .php_history
-rw------- 1 camdennarzt staff 13K 9 Feb 2016 .psql_history
drwxr-xr-x 5 camdennarzt staff 170B 15 Jul 2014 .rbenv
-rw------- 1 camdennarzt staff 1.0K 1 Nov 21:19 .rnd
lrwxr-xr-x 1 camdennarzt staff 63B 17 Oct 2014 .screenrc -> /Volumes/Users/CamdenNarzt/Programming/Bash/dot-files/.screenrc
-rwx------ 1 camdennarzt staff 56B 24 Mar 2013 .serverauth.9851
-rwx------ 1 camdennarzt staff 698B 1 Oct 2015 .sh_history
drwxr-xr-x 4 root staff 136B 21 Oct 2013 .shsh
-rw------- 1 camdennarzt staff 178B 25 May 2014 .sqlite_history
drwx------ 12 camdennarzt staff 408B 17 Sep 10:13 .ssh
drwxr-xr-x 6 camdennarzt staff 204B 4 Apr 2014 .subversion
drwx------ 4 camdennarzt staff 136B 28 Jul 2012 .thumbnails
drwxr-xr-x 9 camdennarzt staff 306B 28 Sep 12:06 .vagrant.d
drwxr-xr-x 3 camdennarzt staff 102B 14 Jun 2015 .vim
-rwx------ 1 camdennarzt staff 6.5K 14 Jun 2015 .viminfo
lrwxr-xr-x 1 camdennarzt staff 60B 17 Oct 2014 .vimrc -> /Volumes/Users/CamdenNarzt/Programming/Bash/dot-files/.vimrc
-rw-r--r-- 1 camdennarzt staff 118B 2 Apr 2014 .zlogin
-rw-r--r-- 1 camdennarzt staff 59B 2 Apr 2014 .zshrc
drwx------@ 4 camdennarzt staff 136B 17 Dec 2012 Adlm
drwx------@ 22 camdennarzt staff 748B 1 Dec 13:01 Applications
drwx------+ 5 camdennarzt staff 170B 5 Oct 11:04 Desktop
drwx------+ 15 camdennarzt staff 510B 19 Aug 14:59 Documents
drwx------+ 6 camdennarzt staff 204B 24 Nov 18:43 Downloads
drwx---r-x+ 85 camdennarzt staff 2.8K 24 Oct 2015 Library
drwx------+ 20 camdennarzt staff 680B 6 Aug 2014 Movies
drwx------+ 11 camdennarzt staff 374B 17 Sep 13:17 Music
drwx------+ 15 camdennarzt staff 510B 27 Apr 2015 Pictures
drwx------@ 34 camdennarzt staff 1.1K 25 Oct 2015 Programming
drwxr-xr-x@ 7 camdennarzt staff 238B 1 Nov 21:02 Public
drwxrwx--- 32 camdennarzt _www 1.1K 4 Jun 2014 Sites
drwxr-xr-x 15 camdennarzt staff 510B 13 Dec 10:16 VirtualBox VMs
If you mean is homebrew installed in /usr/local then yes it is, but you guys moved into /usr/local/Homebrew a while back I think so that is where the .git dir is.
contents of /usr/local/Homebrew :
drwxr-xr-x 16 camdennarzt admin 544B 18 Dec 14:27 .git
drwxr-xr-x 4 camdennarzt admin 136B 13 Dec 08:18 .github
-rw-r--r-- 1 camdennarzt admin 1.0K 1 Nov 21:30 .gitignore
-rw-r--r-- 1 camdennarzt admin 450B 13 Dec 08:18 .travis.yml
-rw-r--r-- 1 camdennarzt admin 291B 1 Nov 21:30 .yardopts
-rw-r--r-- 1 camdennarzt admin 98B 13 Dec 08:18 CHANGELOG.md
-rw-r--r-- 1 camdennarzt admin 3.1K 1 Nov 21:30 CODEOFCONDUCT.md
-rw-r--r-- 1 camdennarzt admin 697B 1 Nov 21:30 CONTRIBUTING.md
-rw-r--r-- 1 camdennarzt admin 1.3K 13 Dec 08:18 LICENSE.txt
drwxr-xr-x 6 camdennarzt admin 204B 1 Dec 09:31 Library
-rw-r--r-- 1 camdennarzt admin 5.0K 13 Dec 08:18 README.md
drwxr-xr-x 3 camdennarzt admin 102B 1 Nov 21:30 bin
drwxr-xr-x 4 camdennarzt admin 136B 1 Nov 21:30 completions
drwxr-xr-x 39 camdennarzt admin 1.3K 13 Dec 08:18 docs
drwxr-xr-x 4 camdennarzt admin 136B 24 Nov 09:47 manpages
@CamJN Assuming you can still reproduce: what does git tags --list and ls /usr/local/Homebrew/.git/refs/tags/ output? Trying to figure out if the tag just doesn't exist in Git yet or if it's a syntax error.
camdennarzt@WALLE:/usr/local/Homebrew [stable L|鉁擼 $ git tags --list ; ls /usr/local/Homebrew/.git/refs/tags/
git: 'tags' is not a git command. See 'git --help'.
Did you mean one of these?
stage
tag
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.7.1 0.8 0.8.1 0.9 0.9.1 0.9.2 0.9.3 0.9.4 0.9.5 0.9.8 0.9.9 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5
camdennarzt@WALLE:/usr/local/Homebrew [stable L|鉁擼 $ git tag --list ; ls /usr/local/Homebrew/.git/refs/tags/
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.7.1
0.8
0.8.1
0.9
0.9.1
0.9.2
0.9.3
0.9.4
0.9.5
0.9.8
0.9.9
1.0.0
1.0.1
1.0.2
1.0.3
1.0.4
1.0.5
1.0.6
1.0.7
1.0.8
1.0.9
1.1.0
1.1.1
1.1.2
1.1.3
1.1.4
1.1.5
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.7.1 0.8 0.8.1 0.9 0.9.1 0.9.2 0.9.3 0.9.4 0.9.5 0.9.8 0.9.9 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5
I've been having this same issue, and decided to just try messing with git. I navigated to '/usr/local/Homebrew' and ran 'git pull origin master' with master being my only branch. Stuff got pulled down, and then I ran a 'brew update' and 'brew upgrade' and both worked properly without all of the previous 'fatal' issues.
So try that and see if it works for you as well. I do not yet know if the problem will come back again in the future (as it does with the previous fix).
Sorry for radio silence, been ill. I'll look into this over the Christmas vacation.
No problem, just let me know whenever you need something checked/tested.
Hello,
I have the same issue:
fatal: Cannot update paths and switch to branch 'stable' at the same time.
Did you intend to checkout 'refs/tags/1.1.5' which can not be resolved as commit?
fatal: Needed a single revision
invalid upstream refs/tags/1.1.5
Updated 2 taps (caskroom/cask, homebrew/core).
Homebrew 1.1.5
This morning same with:
invalid upstream refs/tags/1.1.6
Update on my comment from 18 days ago: the problem has now returned, with refs/tags/1.1.6. Brew doctor says that the system is ready to brew.
Same issue appeared for me a few days ago.
brew update
fatal: Cannot update paths and switch to branch 'stable' at the same time.
Did you intend to checkout 'refs/tags/1.1.6' which can not be resolved as commit?
fatal: Needed a single revision
invalid upstream refs/tags/1.1.6
Already up-to-date.
Resolved with:
cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew update
Thanks for all your work @MikeMcQuaid!
If this affected you before it's still going to affect you. Unfortunately I'm still unable to get to the bottom of this issue.
Can we please see the contents of /usr/local/Homebrew/.git/config ?
cat /usr/local/Homebrew/.git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
autocrlf = false
[remote "origin"]
url = https://github.com/Homebrew/brew
fetch = +refs/heads/*:refs/remotes/origin/*
[homebrew]
analyticsmessage = true
analyticsuuid = XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
Again :
fatal: Cannot update paths and switch to branch 'stable' at the same time.
Did you intend to checkout 'refs/tags/1.1.7' which can not be resolved as commit?
fatal: Needed a single revision
invalid upstream refs/tags/1.1.7
It works after:
cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew update
But back again ...
It will happen every time there is a new tag until we figure out what is wrong.
If this does fail for you your brew config output immediately after the failure (and before running the git reset --hard) would be useful.
[email protected] >>> brew update
fatal: Cannot update paths and switch to branch 'stable' at the same time.
Did you intend to checkout 'refs/tags/1.1.7' which can not be resolved as commit?
fatal: Needed a single revision
invalid upstream refs/tags/1.1.7
Updated 1 tap (homebrew/core).
Pre git reset --hard:
[email protected] >>> brew config
HOMEBREW_VERSION: >1.1.0 (no git repository)
ORIGIN: https://github.com/Homebrew/brew
HEAD: 276d00938cd6ea47fc07af27b96755651bb85626
Last commit: 5 weeks ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 9f91c9cc05ff5119954de276a6b0b992831f7da4
Core tap last commit: 5 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit sandybridge
Homebrew Ruby: 2.0.0-p648
Clang: 8.0 build 800
Git: 2.10.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: N/A
macOS: 10.12.2-x86_64
Xcode: 8.2.1
CLT: N/A
X11: 2.7.11 => /opt/X11
Post git reset --hard
[email protected] >>> git reset --hard
HEAD is now at 276d009 Merge pull request #1615 from zachwhaley/fish_functions
[email protected] >>> brew config
HOMEBREW_VERSION: >1.1.0 (no git repository)
ORIGIN: https://github.com/Homebrew/brew
HEAD: 276d00938cd6ea47fc07af27b96755651bb85626
Last commit: 5 weeks ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 9f91c9cc05ff5119954de276a6b0b992831f7da4
Core tap last commit: 5 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit sandybridge
Homebrew Ruby: 2.0.0-p648
Clang: 8.0 build 800
Git: 2.10.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: N/A
macOS: 10.12.2-x86_64
Xcode: 8.2.1
CLT: N/A
X11: 2.7.11 => /opt/X11
brew config HOMEBREW_VERSION: >1.1.0 (no git repository)
Is anyone else getting that output?
This is still a mystery to me. Next person who can reproduce it: can you rerun brew update --debug --verbose and stick your output in a Gist? CC @CamJN who has been pretty responsive here.
I figured out the problem on my end, it turns out that one or more uses of grep were using my $GREP_OPTIONS envvar and breaking b/c I have color forced on. I'd changed that on my main box but hadn't synced my dotfiles to my other laptop in a while.
It might be worth doing an unset GREP_OPTIONS at the start of the script.
Hey i've got color forced on for grep too. Nice find!
I've got export GREP_OPTIONS="--color=auto" which feels more sensible. This will be addressed by https://github.com/Homebrew/brew/issues/932 but in the mean time I'm going to make a rare exception and filter GREP_OPTIONS. Great work here @CamJN.
Most helpful comment
Try to run
cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew update