GIT_DISCOVERY_ACROSS_FILESYSTEM not set

前端 未结 8 1619
忘了有多久
忘了有多久 2020-12-07 14:00

I have searched and read few post but my problem is not the same as descirbed. So here\'s the issue: using git clone into folder under external partition of the disk works f

相关标签:
8条回答
  • 2020-12-07 14:33

    Check whether you are actually under a github repo.

    So, listing of .git/ should give you results..otherwise you may be some level outside your repo.

    Now, cd to your repo and you are good to go.

    0 讨论(0)
  • 2020-12-07 14:34

    The problem is you are not in the correct directory. A simple fix in Jupyter is to do the following command:

    1. Move to the GitHub directory for your installation
    2. Run the GitHub command

    Here is an example command to use in Jupyter:

    %%bash
    cd /home/ec2-user/ml_volume/GitHub_BMM
    git show
    

    Note you need to do the commands in the same cell.

    0 讨论(0)
  • 2020-12-07 14:38

    I came into this issue when I copy my local repository.

    sudo cp -r original_repo backup_repo
    cd backup_repo
    
    git status
    fatal: Not a git repository (or any parent up to mount point /data)
    Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
    

    I've try git init as some answer suggested, but it doesn't work.

    sudo git init
    Reinitialized existing Git repository in /data/HQ/SC_Educations/hq_htdocs/HQ_Educations_bak/.git/
    

    I solved it by change the owner of the repo

    sudo chown -R www:www ../backup_repo
    
    git status
    # On branch develop
    nothing to commit, working directory clean
    
    0 讨论(0)
  • 2020-12-07 14:39

    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
    
    0 讨论(0)
  • 2020-12-07 14:40

    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 doesn't, just let me know.

    0 讨论(0)
  • 2020-12-07 14:41

    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  <--:root@ns1:[/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 user's 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  <--:root@ns1:[/etc]
    --PRODUCTION--(16:48:54)--> export GIT_DISCOVERY_ACROSS_FILESYSTEM=0
    
    -->  UBIk  <--:root@ns1:[/etc]
    --PRODUCTION--(16:57:35)--> git status
    On branch master
    nothing to commit, working tree clean
    
    -->  UBIk  <--:root@ns1:[/etc]
    --PRODUCTION--(16:57:40)--> touch apache2/me
    
    -->  UBIk  <--:root@ns1:[/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  <--:root@ns1:[/etc]
    --PRODUCTION--(16:57:47)--> cd apache2
    
    -->  UBIk  <--:root@ns1:[/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  <--:root@ns1:[/etc/apache2]
    --PRODUCTION--(16:57:52)--> export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
    
    -->  UBIk  <--:root@ns1:[/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

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