请.git目录网站无法访问 [英] Make .git directory web inaccessible

查看:497
本文介绍了请.git目录网站无法访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我使用github上(闭源)跟踪变化和更新的网站一个网站。唯一的问题是,它出现在.git目录是通过网络进行访问。我怎样才能阻止这一点,仍然可以使用git?

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 stop this and still be able to use git?

我应该使用的.htaccess? 我应该改变git的权限?

Should I use .htaccess? Should I change permissions of .git?

推荐答案

创建一个的.htaccess 文件中的 git的文件夹,并把下面这个文件:

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

Order allow,deny
Deny from all

这篇关于请.git目录网站无法访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆