{"id":747,"date":"2022-12-01T21:48:28","date_gmt":"2022-12-01T16:18:28","guid":{"rendered":"https:\/\/www.cyberaka.com\/?p=747"},"modified":"2022-12-01T21:49:33","modified_gmt":"2022-12-01T16:19:33","slug":"duplicating-a-git-repository","status":"publish","type":"post","link":"https:\/\/www.cyberaka.com\/?p=747","title":{"rendered":"Duplicating a Git repository"},"content":{"rendered":"\n<p>I was working in a personal Git repository and I wanted to make a duplicate copy of it under a different organisation. The following approach worked well for me:<\/p>\n\n\n\n<p>Open Terminal \/ Command Prompt and Clone the existing source repo:<br><code>git clone --bare https:\/\/your_source_repository_url<\/code><\/p>\n\n\n\n<p>Make sure you don&#8217;t skip the &#8220;&#8211;bare&#8221; portion of the command line.<br>You will see that a new folder is created from your source repository.<\/p>\n\n\n\n<p><br>Move inside the folder:<br><code>cd your_source_repository<\/code><br><\/p>\n\n\n\n<p>Now we need to push the files from your source repository into your target repository:<br><code>git push --mirror https:\/\/target_repository_url<\/code><\/p>\n\n\n\n<p>Make sure your don&#8217;t skip the &#8220;&#8211;mirror&#8221; portion of the command line. Also this command has to be executed from the source repository&#8217;s clone location folder. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was working in a personal Git repository and I wanted to make a duplicate copy of it under a different organisation. The following approach worked well for me: Open Terminal \/ Command Prompt and Clone the existing source repo:git clone &#8211;bare https:\/\/your_source_repository_url Make sure you don&#8217;t skip the &#8220;&#8211;bare&#8221; portion of the command line.You [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56,23],"tags":[],"class_list":["post-747","post","type-post","status-publish","format-standard","hentry","category-git","category-programming"],"_links":{"self":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/747","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=747"}],"version-history":[{"count":2,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/747\/revisions"}],"predecessor-version":[{"id":749,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/747\/revisions\/749"}],"wp:attachment":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=747"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=747"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=747"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}