【问题标题】:git stash not working in an IntelliJ PowerShell, why is that?git stash 在 IntelliJ PowerShell 中不起作用,这是为什么呢?
【发布时间】:2019-04-13 21:06:57
【问题描述】:

我使用 scoop 安装了 git,通常它似乎工作正常,但我遇到了一个奇怪的情况。当我尝试在 IntelliJ(实际上是 PyCharm)内的 PowerShell 控制台中存储更改时,我收到此错误:

> git stash
fatal: could not exec C:/Users/pupeno/scoop/apps/git/current/mingw64/libexec/git-core/git-legacy-stash: No such file or directory

确实该文件不存在;但是在独立的 PowerShell 上运行 git stash 是可行的。知道为什么会这样吗?

我将 PowerShell 配置为我的终端的方式是这样的:

这就是错误的样子:

【问题讨论】:

  • When I try to stash changes in a PowerShell console inside IntelliJ你是怎么打开ps控制台的?
  • @Andrey:我将 IntelliJ 中的终端设置为 powershell.exe,然后打开一个终端。我会在问题中添加这个细节。
  • 我也有同样的问题。我可以在独立 cmd 中运行 stash 命令,但不能在 PyCharm 中运行。您已经找到解决方案了吗?

标签: git powershell intellij-idea pycharm


【解决方案1】:

虽然错误输出了上述位置,但文件本身应该在git安装文件夹下:

C:\Program Files\Git\mingw64\libexec\git-core

但是在独立的 PowerShell 上运行 git stash 可以。知道为什么会这样吗?

问题可能是由于文件夹名称中有空格。
Windows 知道如何处理它。

要验证这确实是问题,请安装 git 便携版,更新配置并检查是否有错误。

Git 便携版:https://github.com/sheabunge/GitPortable/

【讨论】:

  • 这不是安装 Git 的地方,它在 C:/Users/pupeno/scoop/apps/git/current/ 中。我用勺子安装了它。我认为路径中没有空格,但也许我遗漏了一些东西。
猜你喜欢
  • 1970-01-01
  • 2018-11-12
  • 2012-01-03
  • 1970-01-01
  • 2016-01-04
  • 2020-09-19
  • 2018-11-04
  • 1970-01-01
相关资源
最近更新 更多