[英]fish shell changes how git stash references work. How to configure the shell to fix this?
I started to use fish shell and everything was going well...until I tried to work with stashes.我开始使用鱼壳,一切都很顺利……直到我尝试使用 stashes。
For some reason: git stash show -p stash@{1}
would result in:出于某种原因:
git stash show -p stash@{1}
会导致:
error message: stash@1 is not a valid reference
错误消息:
stash@1 is not a valid reference
For the longest time I didn't catch that the error message did not contain {}
for the stash number.很长一段时间我都没有发现错误消息不包含存储编号的
{}
。
I eventually figured out that I had to quote the stash reference: git stash show -p 'stash@{1}'
我最终发现我必须引用 stash 引用:
git stash show -p 'stash@{1}'
Is there some sort of configuration of the shell that I need to set?我需要设置某种外壳配置吗?
I couldn't find any information about the fish shell interpreting {}
as something else or stripping out the curly brackets.我找不到有关将
{}
解释为其他内容或去除大括号的鱼壳的任何信息。
As of fish shell 3.1 (released today!), the quoting is no longer required.从fish shell 3.1(今天发布!)开始,不再需要引用。
Prior to 3.1, the {1}
is understood as a bracket expansion and so must be quoted to get the literal brackets.在 3.1 之前,
{1}
被理解为括号扩展,因此必须引用以获取文字括号。
(The behavior was changed in this issue .) (此问题中的行为已更改。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.