Make .git directory web inaccessible

后端 未结 9 1675
耶瑟儿~
耶瑟儿~ 2020-11-30 17:22

I have a website that I use github (closed source) to track changes and update site. The only problem is, it appears the .git directory is accessible via the web. How can I

9条回答
  •  有刺的猬
    2020-11-30 18:06

    Create a .htaccess file in the .git folder and put the following in this file:

    Order allow,deny
    Deny from all
    

    But note, that it would be lost if you ever re-cloned the repository

提交回复
热议问题