uuair
V2EX  ›  macOS

最近 brew 的提示,搞不懂啊。。

  •  
  •   uuair · Jan 28, 2019 · 5962 views
    This topic created in 2688 days ago, the information mentioned may be changed or developed.

    brew 更新的时候,提示是这个:

    Ignoring path homebrew-cask/
    To restore the stashed changes to /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask run:
      'cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask && git stash pop'
    Updated 2 taps (homebrew/core and homebrew/cask).
    ==> Updated Formulae
    

    我一看,提示的还挺详细,那么就继续呗:

    cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask && git stash pop
    Already up to date!
    On branch master
    Your branch is up to date with 'origin/master'.
    
    Untracked files:
      (use "git add <file>..." to include in what will be committed)
    
    	homebrew-cask/
    
    nothing added to commit but untracked files present (use "git add" to track)
    Dropped refs/stash@{0} (7f413ded69914ef213d6e822b4679367d2c7c46e)  
    

    然后捏????怎么不对啊。。。

    8 replies    2021-05-31 21:25:47 +08:00
    Lax
        1
    Lax  
       Jan 28, 2019
    是不是多了个目录: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/homebrew-cask/
    猜的
    lovestudykid
        2
    lovestudykid  
       Jan 28, 2019
    我也一直遇到这个问题,执行了那条命令后可能会修复,但过一段时间又出现。
    没改过那些文件,但有次 git clone 下来,查找一个软件历史版本安装过。
    yuikns
        3
    yuikns  
       Jan 28, 2019
    > nothing added to commit but untracked files present (use "git add" to track)


    建议:

    cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
    git add . -A
    git stash
    git stash drop
    git reset --hard origin/master
    wd
        4
    wd  
       Jan 28, 2019 via iPhone
    如果自己没动过那目录的话 应该可以删除然后重新 tap 一下
    uuair
        5
    uuair  
    OP
       Jan 28, 2019
    @Lax #1 没有啊。。


    @yuikns #3 我试了一下,并没有解决,还是老样子。。


    @wd #4 只好如此了,我回头试试
    xwxw
        6
    xwxw  
       May 14, 2019
    如果没使用 brew-cask,则直接把 /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask 这个目录删除即可。
    CFO
        7
    CFO  
       Mar 14, 2020
    试下 brew update-reset
    isteveyang
        8
    isteveyang  
       May 31, 2021
    cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask && git stash pop

    如果出现
    .DS_Store already exists, no checkout
    error: could not restore untracked files from stash
    The stash entry is kept in case you need it again.

    那就是.DS_Store 一开始没被 ignore 的问题,直接
    git stash && git clean -d -f

    就 OK 了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5992 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 57ms · UTC 03:27 · PVG 11:27 · LAX 20:27 · JFK 23:27
    ♥ Do have faith in what you're doing.