[git] 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. When I cd into my rails work directory on the server, i can't see any git info in my zsh prompt. If i try a git pull origin, i get the following error message:

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? Wouldn't I also need to set up textmate and other software to use ssh? And wouldn't I need to remote desktop to install DMG's and so on? 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?

PS - MacFusion can also mount the server over FTP - would that be preferable to SSH?

This question is related to git ssh sshfs macfuse

The answer is


I got this error until I realized that I hadn't intialized a Git repository in that folder, on a mounted vagrant machine.

So I typed git init and then git worked.


My Problem was that I was not in the correct git directory that I just cloned.


You will also get this if git doesn't have permissions to read the config files. It will just go up in the hierarchy tree until it needs to cross file systems.


Coming here from first Google hit:

You can turn off the behavior AND and warning by exporting GIT_DISCOVERY_ACROSS_FILESYSTEM=1.

On heroku, if you heroku config:set GIT_DISCOVERY_ACROSS_FILESYSTEM=1 the warning will go away.

It's probably because you are building a gem from source and the gemspec shells out to git, like many do today. 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 :)

My answer is a duplicate of: - comment GIT_DISCOVERY_ACROSS_FILESYSTEM problem when working with terminal and MacFusion


Try a different protocol. git:// may have problems from your firewall, for example; try a git clone with https: instead.


Examples related to git

Does the target directory for a git clone have to match the repo name? Git fatal: protocol 'https' is not supported Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) git clone: Authentication failed for <URL> destination path already exists and is not an empty directory SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 GitLab remote: HTTP Basic: Access denied and fatal Authentication How can I switch to another branch in git? VS 2017 Git Local Commit DB.lock error on every commit How to remove an unpushed outgoing commit in Visual Studio?

Examples related to ssh

Starting ssh-agent on Windows 10 fails: "unable to start ssh-agent service, error :1058" How to solve "sign_and_send_pubkey: signing failed: agent refused operation"? key_load_public: invalid format ssh connection refused on Raspberry Pi Getting permission denied (public key) on gitlab Verify host key with pysftp Can't connect to Postgresql on port 5432 Checkout Jenkins Pipeline Git SCM with credentials? How to open remote files in sublime text 3 how to setup ssh keys for jenkins to publish via ssh

Examples related to sshfs

Unmount the directory which is mounted by sshfs in Mac GIT_DISCOVERY_ACROSS_FILESYSTEM problem when working with terminal and MacFusion

Examples related to macfuse

GIT_DISCOVERY_ACROSS_FILESYSTEM problem when working with terminal and MacFusion