我在 Windows 上遇到与 Git 相关的问题,无法从 git 上的存储库中提取更改。我能够添加、提交和推送我的更改,但不能拉取。
它给了我一个错误:
致命:C:**\Git/libexec/git-core/git-pull 不能在没有
工作树。
在搜索这个错误后,我得到了一些关于 SO 的链接,它要求删除工作树或工作目录环境变量。这个链接似乎更多地解释了 git 的工作原理,而不是引用如何解决它,并且似乎没有一个特定于 Windows。所以我发布这个问题
我的不是一个裸存储库,这里是 git 配置文件内容:
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://[email protected] /cdn-cgi/l/email-protection/Project/projectname.git
[branch "master"]
remote = origin
merge = refs/heads/master
我第一次在 Windows 上使用 git,我使用 mysgit。我是否需要设置其他参数或一些特定于 Windows 的环境变量,就像在 ubuntu 上使用 git 一样,无需特殊步骤。
还引用了此链接,但似乎不是最新的,因为本文中指定的内容都不存在。Link http://ryanalberts.com/402/fatal-cprogram-filesgitlibexecgit-coregit-pull-cannot-be-used-without-a-working-tree/
任何建议或帮助表示赞赏。
谢谢,让我知道这个问题是否适合这个论坛,或者我应该将其发布给超级用户。
Edit:
Eckes 发帖后,它帮助我找出了缺少工作树的错误。
我正在使用的工作站安装了另一个版本的 git,当我检查环境变量时,它被设置为它,一旦我清理它,我就不再收到之前的错误了,但是 pull 仍然无法工作,收到错误:
EDIT
remote: Counting objects: 132, done.
remote: Compressing objects: 100% (64/64), done.
remote: Total 104 (delta 74), reused 70 (delta 40)
Receiving objects: 100% (104/104), 33.05 KiB, done.
Resolving deltas: 100% (74/74), completed with 24 local objects.
fatal: write failure on 'stdout': Bad file descriptor
error: https://github.com/Project/projectname.git did not send all necessary objects