{"id":13388,"date":"2020-05-13T14:49:05","date_gmt":"2020-05-13T14:49:05","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=13388"},"modified":"2021-07-20T07:04:44","modified_gmt":"2021-07-20T07:04:44","slug":"security-practices-for-using-git-repository-in-production-for-deployment-2","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/security-practices-for-using-git-repository-in-production-for-deployment-2\/","title":{"rendered":"Security practices for using git repository in production for deployment"},"content":{"rendered":"\n<p>Many times, people use the git repository to host websites in productions by clone-push-pull but it has one drawback, it appears the .git directory is accessible via the web. How we can prevent this? Here there are 2 ways which are recommended given below;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>One redirects to a 404 aka to issue a 404 (w\/ mod_rewrite):<\/li><li>Redirect it to the domain root<\/li><\/ul>\n\n\n\n<script src=\"https:\/\/gist.github.com\/devops-school\/04caa8be4776414e57a04e3e9b01d762.js\"><\/script>\n\n\n\n<p>Git Tutorials | Github Tutorials | Git using Github Crash Course<\/p>\n\n\n\n<p><a href=\"https:\/\/bit.ly\/2Un3W4i\" target=\"_blank\" rel=\"noopener\">https:\/\/bit.ly\/2Un3W4i<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Many times, people use the git repository to host websites in productions by clone-push-pull but it has one drawback, it appears the .git directory is accessible via the web. How&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[38],"tags":[],"class_list":["post-13388","post","type-post","status-publish","format-standard","hentry","category-git"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/13388","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=13388"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/13388\/revisions"}],"predecessor-version":[{"id":22576,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/13388\/revisions\/22576"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=13388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=13388"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=13388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}