How to secure Magento version control systems
In .htaccess on your server config file.
(1)
RewriteEngine on
RewriteRule "^(.*/)?\.git/" - [F,L]
And (2)
RedirectMatch 404 /\.git
Place this both method in .htaccess
file.
It hides any file or directory whose name begins with .git
Like .git
directory or .gitignore
file by returning a 404.