git – GIT_DISCOVERY_ACROSS_FILESYSTEM not set

git – GIT_DISCOVERY_ACROSS_FILESYSTEM not set

Just type git init into your command line and press enter. Then run your command again, you probably were running git remote add origin [your-repository].

That should work, if it doesnt, just let me know.

ran across this page and several like it all talking about the GIT_DISCOVERY_ACROSS_FILESYSTEM not set message. In my case our sys admin had decided that the apache2 directory needed to be on a mounted filesystem in case the disk for the server stopped working and had to get rebuilt. I found this with a simple df command:

-->  UBIk  <--:[email protected]:[/etc]
--PRODUCTION--(16:48:43)--> df -h
Filesystem                           Size  Used Avail Use% Mounted on
<snip>
/dev/mapper/vgraid-lvapache           63G   54M   60G   1% /etc/apache2
<snip>

To fix this I just put the following in the root users shell (as they are the only ones who need to be looking at etckeeper revisions:

export GIT_DISCOVERY_ACROSS_FILESYSTEM=1

and all was well and good…much joy.

More notes:

-->  UBIk  <--:[email protected]:[/etc]
--PRODUCTION--(16:48:54)--> export GIT_DISCOVERY_ACROSS_FILESYSTEM=0

-->  UBIk  <--:[email protected]:[/etc]
--PRODUCTION--(16:57:35)--> git status
On branch master
nothing to commit, working tree clean

-->  UBIk  <--:[email protected]:[/etc]
--PRODUCTION--(16:57:40)--> touch apache2/me

-->  UBIk  <--:[email protected]:[/etc]
--PRODUCTION--(16:57:45)--> git status
On branch master
Untracked files:
  (use git add <file>... to include in what will be committed)

    apache2/me

nothing added to commit but untracked files present (use git add to track)

-->  UBIk  <--:[email protected]:[/etc]
--PRODUCTION--(16:57:47)--> cd apache2

-->  UBIk  <--:[email protected]:[/etc/apache2]
--PRODUCTION--(16:57:50)--> git status
fatal: Not a git repository (or any parent up to mount point /etc/apache2)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
-->  UBIk  <--:[email protected]:[/etc/apache2]
--PRODUCTION--(16:57:52)--> export GIT_DISCOVERY_ACROSS_FILESYSTEM=1

-->  UBIk  <--:[email protected]:[/etc/apache2]
--PRODUCTION--(16:58:59)--> git status
On branch master
Untracked files:
  (use git add <file>... to include in what will be committed)

    me

nothing added to commit but untracked files present (use git add to track)

Hopefully that will help someone out somewhere…
-wc

git – GIT_DISCOVERY_ACROSS_FILESYSTEM not set

For complete the accepted answer,
Had the same issue.
First specified the remote

git remote add origin https://github.com/XXXX/YYY.git

git fetch 

Then get the code

git pull origin master

Leave a Reply

Your email address will not be published.