{"id":6754,"date":"2022-05-15T11:58:18","date_gmt":"2022-05-15T06:28:18","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=6754"},"modified":"2022-05-15T12:40:42","modified_gmt":"2022-05-15T07:10:42","slug":"mirroring-a-repository","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/mirroring-a-repository\/","title":{"rendered":"Mirroring a Repository"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Please follow the below steps to mirror a repository.<br><br>1) Create a new private repo in the destination GitHub account with the same repo name or different name.<br>2) Open\u00a0Terminal<br>3) Create a bare clone of the repository in the terminal with the below command.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">git clone --bare https:\/\/github.com\/exampleuser\/old-repository.git<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.24.55-AM.jpg\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"175\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.24.55-AM-1024x175.jpg\" alt=\"\" class=\"wp-image-6755\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.24.55-AM-1024x175.jpg 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.24.55-AM-300x51.jpg 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.24.55-AM-768x131.jpg 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.24.55-AM-1536x262.jpg 1536w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.24.55-AM-850x145.jpg 850w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.24.55-AM.jpg 1676w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">4) Mirror-push to the new repository with the below commands<br><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ cd old-repository.git\n$ git push --mirror https:\/\/github.com\/exampleuser\/new-repository.git<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.33.27-AM.jpg\"><img decoding=\"async\" width=\"1024\" height=\"285\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.33.27-AM-1024x285.jpg\" alt=\"\" class=\"wp-image-6756\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.33.27-AM-1024x285.jpg 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.33.27-AM-300x83.jpg 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.33.27-AM-768x213.jpg 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.33.27-AM-1536x427.jpg 1536w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.33.27-AM-850x236.jpg 850w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.33.27-AM.jpg 1612w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">5) Go and check the private repo( which you have created in step-1) of your destination guthub account, you will be seeing the updated code.<br><br>6) Remove the temporary local repository you created earlier. This is Optional.<br><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ cd ..\n$ rm -rf old-repository.git<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Please find another way of mirroring the repo.<br><\/strong><br>1) Create the private repo in your destination GitHub account. After creating you will get the page which is in the screenshot.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.43.33-AM.png\"><img decoding=\"async\" width=\"1024\" height=\"548\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.43.33-AM-1024x548.png\" alt=\"\" class=\"wp-image-6757\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.43.33-AM-1024x548.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.43.33-AM-300x160.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.43.33-AM-768x411.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.43.33-AM-1536x822.png 1536w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.43.33-AM-561x300.png 561w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.43.33-AM.png 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">2) Goto the bottom and click on &#8220;import code&#8221;. After that you will get the page which is in the screenshot.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.47.01-AM.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"555\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.47.01-AM-1024x555.jpg\" alt=\"\" class=\"wp-image-6758\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.47.01-AM-1024x555.jpg 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.47.01-AM-300x163.jpg 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.47.01-AM-768x416.jpg 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.47.01-AM-1536x832.jpg 1536w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.47.01-AM-554x300.jpg 554w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.47.01-AM.jpg 1698w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">3) Provide the old repo clone URL and click on &#8220;Begin import&#8221;. You repo will be imported with in seconds.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.50.42-AM.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"354\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.50.42-AM-1024x354.jpg\" alt=\"\" class=\"wp-image-6759\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.50.42-AM-1024x354.jpg 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.50.42-AM-300x104.jpg 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.50.42-AM-768x265.jpg 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.50.42-AM-850x294.jpg 850w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/Screenshot-2022-05-15-at-11.50.42-AM.jpg 1390w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">4) Goto new repo and check for the updated code.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Please follow the below steps to mirror a repository. 1) Create a new private repo in the destination GitHub account [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1020],"tags":[952,951,953],"class_list":["post-6754","post","type-post","status-publish","format-standard","hentry","category-containers-kubernetes","tag-duplicate-repo","tag-github-repo-duplicate","tag-repo-mirroring","psol-cat-containers-kubernetes"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-1KW","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6754","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=6754"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6754\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=6754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=6754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=6754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}