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

2019-01-28 00:38:08 +08:00
 uuair

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)  

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

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


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


@wd #4 只好如此了,我回头试试
xwxw
2019-05-14 12:05:53 +08:00
如果没使用 brew-cask,则直接把 /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask 这个目录删除即可。
CFO
2020-03-14 22:18:12 +08:00
试下 brew update-reset
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 了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/531105

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX