简体   繁体   English

使用终端和MacFusion时出现GIT_DISCOVERY_ACROSS_FILESYSTEM问题

[英]GIT_DISCOVERY_ACROSS_FILESYSTEM problem when working with terminal and MacFusion

I'm using MacFusion with OSXFuse(similar to MacFuse) to mount my server over SSH onto my office machine. 我正在使用MacFusion和OSXFuse(类似于MacFuse)将我的服务器通过SSH安装到我的办公室机器上。 When I cd into my rails work directory on the server, i can't see any git info in my zsh prompt. 当我进入服务器上的rails工作目录时,我在zsh提示符中看不到任何git信息。 If i try a git pull origin, i get the following error message: 如果我尝试git pull origin,我收到以下错误消息:

fatal: Not a git repository (or any parent up to mount parent /Volumes)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set)

I know I can ssh to the server but then wouldn't I lose zsh autocorrection & history? 我知道我可以ssh到服务器但是我不会失去zsh autocorrection&history? Wouldn't I also need to set up textmate and other software to use ssh? 我不也需要设置textmate和其他软件才能使用ssh吗? And wouldn't I need to remote desktop to install DMG's and so on? 我不需要远程桌面来安装DMG等等吗? All of that seems like a bit of a hassle. 所有这一切似乎都有点麻烦。

Is there a better way to do what I want to do? 有没有更好的方法来做我想做的事情? Otherwise is there a way to enable GIT_DISCOVERY_ACROSS_FILESYSTEM? 否则有没有办法启用GIT_DISCOVERY_ACROSS_FILESYSTEM?

PS - MacFusion can also mount the server over FTP - would that be preferable to SSH? PS - MacFusion也可以通过FTP安装服务器 - 这比SSH更可取吗?

Are you ssh'ing to a directory that's inside your work tree? 您是否正在使用工作树内的目录? If the root of your ssh mount point doesn't include the .git dir, then zsh won't be able to find git info. 如果ssh挂载点的根目录不包含.git目录,则zsh将无法找到git info。 Make sure you're mounting something that includes the root of the repo. 确保你正在装载包含回购根的东西。

As for GIT_DISCOVERY_ACROSS_FILESYSTEM, it doesn't do what you want. 对于GIT_DISCOVERY_ACROSS_FILESYSTEM,它不能做你想要的。 Git by default will stop at a filesystem boundary. 默认情况下,Git将停在文件系统边界。 If you turn that on (and it's just an env var), then git will cross the filesystem boundary and keep looking. 如果你打开它(它只是一个env var),那么git将跨越文件系统边界并继续寻找。 However, that's almost never useful, because you'd be implying that you have a .git directory on your local machine that's somehow meant to manage a work tree that's comprised partially of an sshfs mount. 但是,这几乎从来没有用过,因为你暗示你的本地机器上有一个.git目录,它以某种方式管理一个部分由sshfs挂载构成的工作树。 That doesn't make much sense. 这没有多大意义。

I got this error until I realized that I hadn't intialized a Git repository in that folder, on a mounted vagrant machine. 我收到此错误,直到我意识到我没有初始化该文件夹中的Git存储库,在已安装的vagrant机器上。

So I typed git init and then git worked. 所以我输入了git init然后git工作了。

You will also get this if git doesn't have permissions to read the config files. 如果git没有读取配置文件的权限,你也会得到这个。 It will just go up in the hierarchy tree until it needs to cross file systems. 它将在层次结构树中上升,直到它需要跨文件系统。

我的问题是我不在我刚刚克隆的正确git目录中。

Coming here from first Google hit: 从第一个谷歌点击来到这里:

You can turn off the behavior AND and warning by exporting GIT_DISCOVERY_ACROSS_FILESYSTEM=1 . 您可以通过导出GIT_DISCOVERY_ACROSS_FILESYSTEM=1来关闭行为AND和警告。

On heroku, if you heroku config:set GIT_DISCOVERY_ACROSS_FILESYSTEM=1 the warning will go away. 在heroku上,如果你使用heroku config:set GIT_DISCOVERY_ACROSS_FILESYSTEM=1 ,警告就会消失。

It's probably because you are building a gem from source and the gemspec shells out to git , like many do today. 这可能是因为你正在从源代码构建一个gem,而gemspec shell就像git一样构建了git So, you'll still get the warning fatal: Not a git repository (or any of the parent directories): .git but addressing that is for another day :) 所以,你仍然会得到fatal: Not a git repository (or any of the parent directories): .git的警告fatal: Not a git repository (or any of the parent directories): .git但是解决这个问题是另一天:)

My answer is a duplicate of: - comment GIT_DISCOVERY_ACROSS_FILESYSTEM problem when working with terminal and MacFusion 我的回答是: - 使用终端和MacFusion时评论GIT_DISCOVERY_ACROSS_FILESYSTEM问题

Try a different protocol. 尝试不同的协议。 git:// may have problems from your firewall, for example; 例如,git://可能会出现防火墙问题; try a git clone with https: instead. 尝试用https:代替git克隆。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 运行作曲家更新时未设置GIT_DISCOVERY_ACROSS_FILESYSTEM - GIT_DISCOVERY_ACROSS_FILESYSTEM not set when running composer update GIT_DISCOVERY_ACROSS_FILESYSTEM 未设置 - GIT_DISCOVERY_ACROSS_FILESYSTEM not set GIT_DISCOVERY_ACROSS_FILESYSTEM 错误 - GIT_DISCOVERY_ACROSS_FILESYSTEM error 在文件系统边界停止(未设置GIT_DISCOVERY_ACROSS_FILESYSTEM) - Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set) Heroku - 在文件系统边界停止(未设置GIT_DISCOVERY_ACROSS_FILESYSTEM) - Heroku - Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set) 使用github部署时,未设置git_discovery_across_filesystem - Deploying with github, git_discovery_across_filesystem not set Python:致命:不是 git 存储库在文件系统边界停止(未设置 GIT_DISCOVERY_ACROSS_FILESYSTEM) - Python: fatal: not a git repository Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set) 设置 GIT_DISCOVERY_ACROSS_FILESYSTEM 以允许服务访问存储在符号链接下的 git repo - Set GIT_DISCOVERY_ACROSS_FILESYSTEM to allow service to access git repo stored under a symlink GIt 致命:不是 git 存储库(或安装点 /home 之前的任何父存储库)在文件系统边界处停止(未设置 GIT_DISCOVERY_ACROSS_FILESYSTEM) - GIt fatal: Not a git repository (or any parent up to mount point /home) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set) 终端的git不起作用 - terminal's git not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM