V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
uuair
V2EX  ›  macOS

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

  •  
  •   uuair · 2019-01-28 00:38:08 +08:00 · 4895 次点击
    这是一个创建于 1914 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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 条回复    2021-05-31 21:25:47 +08:00
    Lax
        1
    Lax  
       2019-01-28 02:33:32 +08:00
    是不是多了个目录: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/homebrew-cask/
    猜的
    lovestudykid
        2
    lovestudykid  
       2019-01-28 02:51:10 +08:00
    我也一直遇到这个问题,执行了那条命令后可能会修复,但过一段时间又出现。
    没改过那些文件,但有次 git clone 下来,查找一个软件历史版本安装过。
    yuikns
        3
    yuikns  
       2019-01-28 07:15:40 +08:00
    > 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  
       2019-01-28 07:38:22 +08:00 via iPhone
    如果自己没动过那目录的话 应该可以删除然后重新 tap 一下
    uuair
        5
    uuair  
    OP
       2019-01-28 08:57:41 +08:00
    @Lax #1 没有啊。。


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


    @wd #4 只好如此了,我回头试试
    xwxw
        6
    xwxw  
       2019-05-14 12:05:53 +08:00
    如果没使用 brew-cask,则直接把 /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask 这个目录删除即可。
    CFO
        7
    CFO  
       2020-03-14 22:18:12 +08:00
    试下 brew update-reset
    isteveyang
        8
    isteveyang  
       2021-05-31 21:25:47 +08:00
    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 了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3245 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 13:22 · PVG 21:22 · LAX 06:22 · JFK 09:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.