问题描述
S:我是git新手,并且在尝试获取最新版本的远程项目时遇到问题。 \dev\prj\myprj [master]> git pull
/ usr / libexec / git-core / git -sh-setup:第266行:cd:.git:没有这样的文件或目录
无法确定git目录的绝对路径
直到今天,它工作正常,奇怪的是,自从上次工作正常以来,我没有改变任何内容。
这是在Windows 7上的。我的项目位于加密驱动器(S :)上,git位于C:
S:\dev\prj\myprj [master]> git --exec-path
C:\Users\matt\AppData\Local\GitHub\PortableGit_656cc1ef6d04f06ddf8b2f5bedbac921caed3b62 / libexec / git-core
手动对上面的exec目录执行cd工作正常(即使有斜杠类型混合)。 >任何想法如何开始计算出什么问题?
Hurray!我曾经(现在仍然)使用GitHub for Windows,偶尔它会让我去Windows Powershell来修复存储库,因为有时它不能做它会自动的,偶尔它会失败,并出现上述错误信息。
我失败的原因不仅仅是我的项目是在加密的驱动器上,而是更多重要的是,有时我会在安装加密驱动器(我手动安装)之前启动GitHub for Windows。即使我关闭了Windows的GitHub,然后安装加密的驱动器,然后重新启动GitHub for Windows,它仍然会返回上述错误,所以当关闭GitHub for Windows时,可能并非所有的GitHubby都被关闭。
我的解决方法是:
- 重新启动
- 安装包含项目的驱动器
- 启动适用于Windows的GitHub
...订单。
I'm a git newbie and am having problems trying to get the latest version of a remote project:
S:\dev\prj\myprj [master]> git pull
/usr/libexec/git-core/git-sh-setup: line 266: cd: .git: No such file or directory
Unable to determine absolute path of git directory
It was working fine until today and strangely I don't think I've changed anything since it last worked fine.
This is on Windows 7. My project is on an encrypted drive (S:) and git is on C:
S:\dev\prj\myprj [master]> git --exec-path
C:\Users\matt\AppData\Local\GitHub\PortableGit_656cc1ef6d04f06ddf8b2f5bedbac921caed3b62/libexec/git-core
Manually doing a cd to the exec directory above works fine (even though there are mixed slash types).
Any ideas how to even start working out what has gone wrong?
Found the solution/workaround! Hurrah!
I was (and still am) using GitHub for Windows, and occasionally it asks me to go to Windows Powershell to fix the repository because sometimes it can't do it automatically, and occasionally it would fail with the above error message.
The reason it was failing for me was not just that my project was on an encrypted drive but, more importantly, that sometimes I would start GitHub for Windows before mounting the encrypted drive (which I manually mount). Even if I then close GitHub for Windows, then mount the encrypted drive, and then relaunch GitHub for Windows it would still come back with the above error, so perhaps not everything GitHubby is being shut down when I close GitHub for Windows.
The workaround for me is to:
- Reboot
- Mount Drive containing project
- Launch GitHub for Windows
...in that order.
这篇关于Git“无法确定git目录的绝对路径”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!