-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
brew update fails #5128
Comments
This is a fresh install?
Can you tell how this outputs? |
[lgw4@mike:~]$ cd /usr/local/ [lgw4@mike:local]$ git fetch origin fatal: 'origin' does not appear to be a git repository fatal: The remote end hung up unexpectedly [lgw4@mike:local]$ git reset --hard origin/master fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree. Use '--' to separate paths from revisions [lgw4@mike:local]$ |
Then run the above. |
This seems to have fixed the problem. [lgw4@mike:local]$ git remote add origin git://github.com/mxcl/homebrew.git [lgw4@mike:local]$ git fetch origin remote: Counting objects: 50, done. remote: Compressing objects: 100% (35/35), done. remote: Total 46 (delta 15), reused 37 (delta 9) Unpacking objects: 100% (46/46), done. From git://github.com/mxcl/homebrew * [new branch] gh-pages -> origin/gh-pages * [new branch] master -> origin/master [lgw4@mike:local]$ git reset --hard origin/master HEAD is now at aff8ce3 Gearmand 0.20 [lgw4@mike:local]$ brew update From http://github.com/mxcl/homebrew * branch master -> FETCH_HEAD Already up-to-date. Any idea what caused the problem? |
Sorry, I really don't. Maybe something broke the installation before it finished. |
Well, I'd like to re-open. I have a fresh install (deleted /usr/local completely) and the same issue.
|
@samueljohn by "deleted |
@amarshall I mean mv /usr/local /usr/__local, so there is no /usr/local |
I agree this is still happening. I tried another fresh Homebrew install on a fresh 10.6.7 install with Xcode 3.2.6 and am still seeing this error. Sure, the steps given by MindTooth above fix the problem, but the problem persists. Might make someone give up and go back to MacPorts (okay, sorry for the troll bait, but still…). |
@Igw4: Indeed, I am coming from MacPorts and I think homebrew is really cool (and the first reason to learn about ruby, even if I am a python lover). |
This issue has also happened for me on 10.6.7 and xcode 3.2.6 on a fresh install. The above steps posted seem to fix the issue... |
If this is happening in fresh installs, the "brew update" is probably broken in some way, and the other maintainers will need to jump in. (I don't use "brew update" personally, I always get fetch.) |
Happened to me twice, once on a MacBook w/ 10.6.7., another on a Hackintosh with 10.6.6. Both coming from MacPorts, if that makes any difference. Adding the origin repo manually seems to have fixed it, but it's a little funky. Otherwise things are working great! |
@MikeMcQuaid @mxcl - something fishy here? I don't use "brew update" so I dunno. |
@adamv if you don't use 'brew update' then what do you use? All the docs I'm reading show that command, and I'm a junkie for updates. So far, it's still much better than that other package manager, but the extra setup to get updates to work is kinda funky. |
I never really use |
I dont have Xcode 4. |
@samueljohn Agreed, it's much clearer. The install script (per the wiki) doesn't initialize a .git (understandably, because we may not have git installed at that point) so when For the time being, I've linked the wiki to this issue, so that other people are aware. |
re: the installer not doing a git init, perhaps in the future, when Xcode 4 is a bit more widespread, the install instructions could suggest that Xcode be installed first, and then the installer could safely run git commands since git is included in the Xcode 4 package. Just a thought. |
@jacknagel: Sure, but Xcode 4 costs (a bit). |
Right. But the installer script just untars the homebrew tarball into /usr/local, and as @digitalcardboard noted, when (Aside: Like you said, XCode 4 isn't free but I have a feeling it might still be included on the Lion install discs, and only cost for people who get Lion via the App Store. Either way, eventually it will become the norm for devs to have XCode 4, or another way of getting the toolchain will emerge.) Edit: my point related to this issue is that |
Well, this is pretty annoying. Because I actually am not able to get homebrew fully working at the moment. I only discovered this issue after deciding to reinstall because of another problem which I can now reproduce and I think might be related to this one. The steps (add remote, fetch, hard reset) to fix the failing update do work, but at least for me have a nasty side effect. After applying them, whenever I run http://github.com/mxcl/homebrew/commits/master/Library/Formula/... is instead returned as http://github.com/matrixagent/homebrew/commits/master/Library/Formula/... i.e. it has my github username instead of @mxcl's and of course it does not exist.
I have never forked homebrew, so I have not the slightest idea why this is happening. As I said, this is reproducable. I also moved my old /usr/local away so that it didn't even exist before installing homebrew. 10.6.7, latest Xcode 3. I never had MacPorts or anything else on this system. |
It looks to me like the info command is broken, as it is putting together the url by looking for a username in your global git config. Didn't notice it until now, but the exact same thing happens on my installation. |
Would be weird however that this only started happening a few days ago then. Was |
Yeah, it's weird. On first glance I'm not even sure why Looking at the history, that bit of code has been there at least since refactor was merged, if not before. |
@adamv: can you provide some insight here re: |
Try the fix here: #5128 (comment) |
OK, so for further information. This started happening with Git 1.7.4 or 1.7.5, as it doesn't happen with the Xcode 4 provided Git which is 1.7.3. |
Those still suffering can:
|
i followed
|
This exact thing happened to me today on a fresh install of Lion from a restore disc. Xcode 4.1 installed, ran the default install instructions, brew update exploded. Should this be reopened? |
@cschep, I had the exact same experience as you. Unfortunately I forget exactly what I did to fix it. |
@dylanvee I did the following that was suggested above: cd I had to sudo the git reset command though.. too weird. |
No, it was a different bug, which we fixed yesterday. if after a working update it persists please open a new ticket. |
Don't know if this also is noteworthy, I had the same issue but was on git 1.6.2, updated git to the latest version and now brew update works for me. |
@idev I had this issue after installing Homebrew and then using it to install the latest git. |
Behaviour for git checkout was changed such that the update would fail because it refused to checkout files on to existing files in the working directory. This was bad behaviour anyway, we should make efforts to keep any local modifications to the Homebrew checkout. Everything is neatly resolved if we just do a --soft reset. Closes Homebrew#6017.
Behaviour for git checkout was changed such that the update would fail because it refused to checkout files on to existing files in the working directory. This was bad behaviour anyway, we should make efforts to keep any local modifications to the Homebrew checkout. Everything is neatly resolved if we just do a --soft reset. Closes Homebrew#6017.
Permission fix fixed this for me. sudo chown -R $USER /usr/local' - as above. Before that I blundered through the git fetch routine. |
I was seeing similar issues with
|
martyvona's solution worked for me, with one additional line: after rm -rf .git, you need to initialize git with: |
Fresh install on Mac OS X 10.8 still fails ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
|
@stonegao It's a permission issue. /usr/local should be owned by the current user.
Remove existing installation (which just failed):
And then re-install
|
@jasonbosco Thanks! Works for me! Specs:
|
Behaviour for git checkout was changed such that the update would fail because it refused to checkout files on to existing files in the working directory. This was bad behaviour anyway, we should make efforts to keep any local modifications to the Homebrew checkout. Everything is neatly resolved if we just do a --soft reset. Closes Homebrew#6017.
cd /usr/local |
Thanks @snez your suggestion is work! |
+1 @snez |
This worked for me:
found here: http://stackoverflow.com/questions/9370552/brew-update-failure-while-executing-git-checkout |
Attempted to install Homebrew on a new machine today. brew update failed.
brew doctor is fine.
brew --env and brew --config look fine, too.
The text was updated successfully, but these errors were encountered: