Set GIT_DISCOVERY_ACROSS_FILESYSTEM to allow service to access git repo stored under a symlink

docker stopping at filesystem boundary (git_discovery_across_filesystem not set)
bamboo git_discovery_across_filesystem not set

We have an Upstart service/job that uses a local clone of a git repo. After relocating the data folder using a symbolic link we now get the following error message:

Failed to run 'git fetch' for /var/company/service/src/program repo; Details: fatal: Not a git repository (or any parent up to mount point /data) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

How can I set GIT_DISCOVERY_ACROSS_FILESYSTEM for the service?


GIT_DISCOVERY_ACROSS_FILESYSTEM is an environmental variable that git looks for when trying to find the root of the repo. If that path exists on another filesystem, the command will produce the above error message to prevent git from crossing filesystem boundaries. You can set the value to true to allow this operation, and most init systems have ways to add environmental variables for a job/service.

For Upstart we just needed to update the /etc/init/servicename.conf file to include env and export keywords:

start on runlevel [2345]
stop on runlevel [^2345]
respawn
respawn limit 10 2
chdir /usr/local/servicename
setgid servicegroup
setuid servicename
limit nofile 1000000 1000000

env GIT_DISCOVERY_ACROSS_FILESYSTEM=true
export GIT_DISCOVERY_ACROSS_FILESYSTEM
exec /usr/local/servicename --cfg /etc/servicename.cfg >> /var/log/servicename.log 2>&1

After reloading the config and restarting the service, the git error message went away.

Git - git Documentation, If you are not at the top-level directory of the working tree, you should tell Git where the top-level of the Set a prefix which gives a path from above a repository down to its root. One use is to give submodules context about the superproject that invoked it. Routines to help parsing remote repository access parameters. 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.


git, Set GIT_DISCOVERY_ACROSS_FILESYSTEM to allow service to access git repo stored under a symlink. 2019-11-13 git 2 Answers 24. We have an Upstart  To add a new remote, use the git remote add command on the terminal, in the directory your repository is stored at. Changing a remote's URL → The git remote set-url command changes an existing remote repository URL. Renaming a remote → Use the git remote rename command to rename an existing remote. Removing a remote →


Type this on your terminal & press enter:-

git init

This will remove the error

fatal: Not a git repository , fatal: Not a git repository, GIT_DISCOVERY_ACROSS_FILESYSTEM not set Running Bamboo as a Windows Service - Troubleshooting Guide fatal: Not a git repository (or any parent up to mount point /mnt) Stopping at filesystem being unable to access the .git directory in the local repository cache  Now that you have a bare copy of your repository, all you need to do is put it on a server and set up your protocols. Let’s say you’ve set up a server called git.example.com that you have SSH access to, and you want to store all your Git repositories under the /opt/git directory.


upstart - St4k, Set GIT_DISCOVERY_ACROSS_FILESYSTEM to allow service to access git repo stored under a symlink. We have an Upstart service/job that uses a local clone  If the GIT_DIR environment variable is set then it specifies a path to use instead of the default .git for the base of the repository. The --git-dir command-line option also sets this value. GIT_WORK_TREE


Symlinks in Windows 10!, Node JS running on Synology Nas, accessing ssh Windows Powershell, port forward, Linux upstart (.conf) script running the app.js Set GIT_DISCOVERY_ACROSS_FILESYSTEM to allow service to access git repo stored under a symlink. 4. GIT_DISCOVERY_ACROSS_FILESYSTEM is an environmental variable that git looks for when trying to find the root of the repo. If that path exists on another filesystem, the command will produce the above error message to prevent git from crossing filesystem boundaries.


git - man pages section 1: User Commands, Many popular development tools like git and package managers like npm recognize and persist symlinks when creating repos or packages,  This chapter covers every basic command you need to do the vast majority of the things you’ll eventually spend your time doing with Git. By the end of the chapter, you should be able to configure and initialize a repository, begin and stop tracking files, and stage and commit changes.