{"id":35,"date":"2019-05-12T11:00:06","date_gmt":"2019-05-12T11:00:06","guid":{"rendered":"https:\/\/tailordev.co.uk\/?p=35"},"modified":"2019-05-12T11:01:00","modified_gmt":"2019-05-12T11:01:00","slug":"what-is-git-clone-bare-command","status":"publish","type":"post","link":"https:\/\/tailordev.co.uk\/?p=35","title":{"rendered":"What is git clone &#8211;bare command?"},"content":{"rendered":"\n<p>Sometimes we need to share out git repo instead of whole working directory. In that case <code>git clone --bare<\/code> command can be used:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>git clone --bare https:\/\/some-repository-link.github.com\/project.git .git<\/code><\/pre>\n\n\n\n<p>After this command in the current directory git bash only create .git (hidden) repo directory and not any of the working folder or files. <\/p>\n\n\n\n<h2>Convert from bare repo to working repo<\/h2>\n\n\n\n<p>With two steps it is very easy:<\/p>\n\n\n\n<p>First, set the <code>core.bare <\/code>config value to <code>false<\/code> :<br><code>$ git config --bool core-bare false<\/code><br>then enter the following command to <code>HARD<\/code> reset your <code>HEAD<\/code> to initial commit and finally it will create your repos working directory:<br><code>$ git reset --hard<\/code><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes we need to share out git repo instead of whole working directory. In that case git clone &#8211;bare command can be used: git clone &#8211;bare https:\/\/some-repository-link.github.com\/project.git .git After this command in the current directory git bash only create .git (hidden) repo directory and not any of the working folder or files. Convert from bare [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[22,21,11],"_links":{"self":[{"href":"https:\/\/tailordev.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/35"}],"collection":[{"href":"https:\/\/tailordev.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tailordev.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tailordev.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tailordev.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=35"}],"version-history":[{"count":1,"href":"https:\/\/tailordev.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/35\/revisions"}],"predecessor-version":[{"id":36,"href":"https:\/\/tailordev.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/35\/revisions\/36"}],"wp:attachment":[{"href":"https:\/\/tailordev.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=35"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tailordev.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=35"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tailordev.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=35"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}