GIT_DISCOVERY_ACROSS_FILESYSTEM problem when working with terminal and MacFusion

前端 未结 6 2095
萌比男神i
萌比男神i 2021-01-31 14:53

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

相关标签:
6条回答
  • 2021-01-31 15:41

    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

    0 讨论(0)
  • 2021-01-31 15:42

    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. 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 by default will stop at a filesystem boundary. If you turn that on (and it's just an env var), then git will cross the filesystem boundary and keep looking. 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. That doesn't make much sense.

    0 讨论(0)
  • 2021-01-31 15:44

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

    0 讨论(0)
  • 2021-01-31 15:48

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

    0 讨论(0)
  • 2021-01-31 15:53

    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.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题