homebrew/core 是 Fish shell 中的浅层克隆

homebrew/core is a shallow clone in Fish shell

我尝试使用 brew install 安装一些东西,然后弹出这个东西

Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

当我复制那个东西来制作它时 运行,这发生了

fish: $(...) is not supported. In fish, please use '(brew)'.
git -C "$(brew --repo homebrew/core)" fetch --unshallow
        ^

这是什么意思,我该如何解决这些问题?是否有可以忽略或修复的解决方法?

关于我的工作站的附加信息:


更新 1: 看起来我是个白痴,把 $ 留在那里。 我确实尝试根据你们的建议修复它,结果就是这样。

从命令中删除 $,像这样

git -C "(brew --repo homebrew/core)" fetch --unshallow

这会发生

fatal: cannot change to '(brew --repo homebrew/core)': No such file or directory

更新 2: 另外,@VonC 通过让我 运行 以下行

来问我 brew --repo homebrew/core 路径是否存在
brew --repo homebrew/core

结果是这样的

/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core

表示存储库路径仍然有效并可以使用

fish-shell/issue 1405

所述

In bash, $(...) is equivalent to backticks, except it's supported inside a double-quoted string.
Fish does not use $(...) or backticks, it uses (...) instead

所以:

git -C (brew --repo homebrew/core) fetch --unshallow

Issue 159 讨论了 $() 命令替换语法的支持。
自 2012 年以来。

fatal: cannot change to '(brew --repo homebrew/core)': No such file or directory

然后仔细检查 brew --repo homebrew/core returns 以及路径是否存在。

作为替代,seen here

git -C $HOMEBREW_CORE fetch --unshallow

应该支持使用"",见“How to remove the shallow clone warning from HomeBrew", but not advisable, from glenn-jackman's .

Simplest explanation for a "shallow clone" is that it's simply a clone of the git repository without the revision history thereby reducing the git repo footprint. You can also specify "depth" to reduce the amount of revision history obtained from a git clone.

在您的情况下,如果您需要完整的历史记录,则需要 fetch --unshallow

看来我做了一个双重错误。
感谢所有对我的评论,我正在做一个 oopsies。非常感谢。

而不是键入

git -C "$(brew --repo homebrew/core)" fetch --unshallow

哪条鱼不喜欢$那一行,

use this instead :

git -C (brew --repo homebrew/core) fetch --unshallow

no $ and ".
AAAAND that's it.

如果这没有帮助,请发表评论。我仍然怀疑是否真的解决了这个问题 lol