"git无法读取当前工作目录没有错误" - posh git(windows 10)

Gia*_*one 7 git powershell github

我收到此错误:Unable to read current working directory: No error当我在任何目录中执行任何git命令.

要在powershell上使用git,我安装了github for windows(GUI版本),编辑powershell配置文件,如下所述:https://git-scm.com/book/it/v2/Git-in-Other-Environments-Git-在-PowerShell的

. (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.ps1")
. $env:github_posh_git\profile.example.ps1
Run Code Online (Sandbox Code Playgroud)

这发生在昨天我更新了github桌面(我现在的版本:3.0.9.0)

我能做什么?

更新:

显然我不是在一个不存在的目录中工作.我试图删除并重新创建目录,但它不起作用.Git不能在任何地方工作,如果我创建一个目录并在其中执行git init,它将无法工作.

Mic*_*ver 11

我在Windows 7中遇到了同样的问题,并发现了一个非常简单的解决方案.而不是输入:

cd ~/My Documents
Run Code Online (Sandbox Code Playgroud)

改为:

cd ~/Documents
Run Code Online (Sandbox Code Playgroud)

〜/ My Documents文件是一个符号链接到〜/文稿是在帐户创建时自动创建的,但Git有麻烦了.

确定Git是否在当前目录中正常工作的一种简单方法是在bash提示符中查找分支名称,如下所示:

~/Documents/someFolder (master)
$
Run Code Online (Sandbox Code Playgroud)

如果你没有看到分支名称,那么Git没有看到它.


Gia*_*one 1

我在 github 上的 posh-git 存储库中将此问题报告为: https: //github.com/dahlbyk/posh-git/issues/236

在另一个项目中,有人遇到了我同样的问题:https ://github.com/git-for-windows/git/issues/473

在我看来,Windows 10 搞砸了一些东西(符号链接?)更新自身并使其正常工作(正如您可以从问题的第二个链接中阅读的那样)来引用我的文档文件夹(我保存所有 github 存储库的地方)我不再写cd documenti(意大利语文件夹名称),但cd documents它就可以了。