gpt4 book ai didi

macos - 每个新提示都会触发错误

转载 作者:行者123 更新时间:2023-12-01 23:15:23 25 4
gpt4 key购买 nike

在通过 brew 更新了一堆实用程序之后,我将 fish shell 从接近 3.0 的版本升级到了 3.3.1。现在,每次我在终端中点击 return 时,都会出现一系列迄今为止无害但非常令人分心的错误消息。

$ ls
README.md node_modules package.json static tsconfig.json
mdsvex.config.cjs package-lock.json src svelte.config.js work.eqg
fatal: ambiguous argument '^/dev/null': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: bad revision '^/dev/null'
fatal: Refusing to point HEAD outside of refs/
fatal: No names found, cannot describe anything.
head: ^/dev/null: No such file or directory
$ echo Hi 👋🤓
Hi 👋🤓
fatal: ambiguous argument '^/dev/null': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: bad revision '^/dev/null'
fatal: Refusing to point HEAD outside of refs/
fatal: No names found, cannot describe anything.
head: ^/dev/null: No such file or directory
$
fatal: ambiguous argument '^/dev/null': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: bad revision '^/dev/null'
fatal: Refusing to point HEAD outside of refs/
fatal: No names found, cannot describe anything.
head: ^/dev/null: No such file or directory
$

注意:我已将我的提示简化为 $,因为其中很多不能很好地复制/粘贴。 Fwiw,我正在使用 Bob the Fish,这是一个屏幕截图:

screenshot of above error message

无论如何......关于如何解决这个问题有什么想法吗?

最佳答案

fish-shell/fish-shell issue 8105提及:

If you encounter these errors in prompt after updating fish shell to 3.3.0:

fatal: not a git repository (or any of the parent directories): .gitfatal: Refusing to point HEAD outside of refs/

Then probably you have error redirection with caret (^) in your prompt.Replace it with 2>.

它表明:

Doing a full grep -r '\^[/&]' ~/.config/fish/ and fixing everything that comes up (that isn't already quoted)

例如:

I ran that command and found the culprit, it was https://github.com/sjl/z-fish.

关于macos - 每个新提示都会触发错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68993559/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com