{"id":220,"date":"2019-10-01T02:07:42","date_gmt":"2019-10-01T02:07:42","guid":{"rendered":"http:\/\/www.legendshub.com\/blog\/?p=220"},"modified":"2020-02-10T19:58:06","modified_gmt":"2020-02-10T19:58:06","slug":"renaming-a-repository-bit-bucket","status":"publish","type":"post","link":"https:\/\/www.legendshub.com\/blog\/2019\/10\/01\/renaming-a-repository-bit-bucket\/","title":{"rendered":"Renaming a repository (Bit bucket)"},"content":{"rendered":"\n<!-- Quick Adsense WordPress Plugin: http:\/\/quickadsense.com\/ -->\n<div class=\"2c935cf620b701aabbb7cc90bbf4023c\" data-index=\"1\" style=\"float: none; margin:0px 0 0px 0; text-align:center;\">\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<script>\r\n  (adsbygoogle = window.adsbygoogle || []).push({\r\n    google_ad_client: \"ca-pub-5554449970657557\",\r\n    enable_page_level_ads: true\r\n  });\r\n<\/script>\n<\/div>\n<h1><\/h1>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>We will be today discussing the process of renaming the repository in Bit bucket or git using command line. We will make sure local copy and remote copy integrate with each other after renaming.<\/p>\n<p>You need to be either an organization owner or have admin permissions for the repository to rename it.<\/p>\n<p>First of we will login into the server we have cloned our repo. Make sure we are in the working copy.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"566\"><em>[ec2-user@ip-172-31-88-185 my-repo-test]$ cd ..<\/em><\/p>\n<p><em>[ec2-user@ip-172-31-88-185 ~]$ ls<\/em><\/p>\n<p><em>my-repo-test<\/em><\/p>\n<p><em>[ec2-user@ip-172-31-88-185 ~]$ pwd<\/em><\/p>\n<p><em>\/home\/ec2-user<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>In this case my repository name is my-repo-test and I will be renaming it to my-repo. First change directory to repository and look for .git folder.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"566\"><em>[ec2-user@ip-172-31-88-185 ~]$ cd my-repo-test\/<\/em><\/p>\n<p><em>[ec2-user@ip-172-31-88-185 my-repo-test]$ ls -latr<\/em><\/p>\n<p><em>total 4<\/em><\/p>\n<p><em>-rw-r&#8211;r&#8211; 1 root&nbsp;&nbsp;&nbsp;&nbsp; root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 39 Sep 22 15:19 README.md<\/em><\/p>\n<p><em>drwxr-xr-x 3 root&nbsp;&nbsp;&nbsp;&nbsp; root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 35 Sep 22 15:19 .<\/em><\/p>\n<p><em>drwx&#8212;&#8212; 4 ec2-user ec2-user 110 Sep 22 15:31 ..<\/em><\/p>\n<p><em>drwxr-xr-x 8 root&nbsp;&nbsp;&nbsp;&nbsp; root&nbsp;&nbsp;&nbsp;&nbsp; 198 Sep 22 15:33 .git<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Change the directory to .git look for config file and open the file. Alternatively one can run config command to view remote commit location.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"566\"><em>[ec2-user@ip-172-31-88-185 my-repo-test]$ cd .git\/<\/em><\/p>\n<p><em>[ec2-user@ip-172-31-88-185 .git]$ ls -ltr<\/em><\/p>\n<p><em>total 28<\/em><\/p>\n<p><em>drwxr-xr-x 2 root root&nbsp; 21 Sep 22 15:19 info<\/em><\/p>\n<p><em>drwxr-xr-x 2 root root 301 Sep 22 15:19 hooks<\/em><\/p>\n<p><em>-rw-r&#8211;r&#8211; 1 root root&nbsp; 73 Sep 22 15:19 description<\/em><\/p>\n<p><em>drwxr-xr-x 2 root root&nbsp;&nbsp; 6 Sep 22 15:19 branches<\/em><\/p>\n<p><em>drwxr-xr-x 7 root root&nbsp; 60 Sep 22 15:19 objects<\/em><\/p>\n<p><em>drwxr-xr-x 5 root root&nbsp; 46 Sep 22 15:19 refs<\/em><\/p>\n<p><em>-rw-r&#8211;r&#8211; 1 root root 114 Sep 22 15:19 packed-refs<\/em><\/p>\n<p><em>drwxr-xr-x 3 root root&nbsp; 30 Sep 22 15:19 logs<\/em><\/p>\n<p><em>-rw-r&#8211;r&#8211; 1 root root 137 Sep 22 15:19 index<\/em><\/p>\n<p><em>-rw-r&#8211;r&#8211; 1 root root&nbsp; 23 Sep 22 15:19 HEAD<\/em><\/p>\n<p><em>-rw-r&#8211;r&#8211; 1 root root 285 Sep 22 15:32 config<\/em><\/p>\n<p><em>-rw-r&#8211;r&#8211; 1 root root 107 Sep 22 15:33 FETCH_HEAD<\/em><\/p>\n<p><em>-rw-r&#8211;r&#8211; 1 root root&nbsp; 41 Sep 22 15:33 ORIG_HEAD<\/em><\/p>\n<p><em>[ec2-user@ip-172-31-88-185 .git]$ cat config<\/em><\/p>\n<p><em>[core]<\/em><\/p>\n<!-- Quick Adsense WordPress Plugin: http:\/\/quickadsense.com\/ -->\n<div class=\"2c935cf620b701aabbb7cc90bbf4023c\" data-index=\"3\" style=\"float: none; margin:0px 0 0px 0; text-align:center;\">\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<script>\r\n  (adsbygoogle = window.adsbygoogle || []).push({\r\n    google_ad_client: \"ca-pub-5554449970657557\",\r\n    enable_page_level_ads: true\r\n  });\r\n<\/script>\n<\/div>\n\n<p><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repositoryformatversion = 0<\/em><\/p>\n<p><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filemode = true<\/em><\/p>\n<p><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bare = false<\/em><\/p>\n<p><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logallrefupdates = true<\/em><\/p>\n<p><em>[remote &#8220;origin&#8221;]<\/em><\/p>\n<p><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; url = https:\/\/winsystech@bitbucket.org\/winsystech\/my-repo-test.git<\/em><\/p>\n<p><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fetch = +refs\/heads\/*:refs\/remotes\/origin\/*<\/em><\/p>\n<p><em>[branch &#8220;master&#8221;]<\/em><\/p>\n<p><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; remote = origin<\/em><\/p>\n<p><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; merge = refs\/heads\/master<\/em><\/p>\n<p><em>[ec2-user@ip-172-31-88-185 .git]$ git config -l<\/em><\/p>\n<p><em>core.repositoryformatversion=0<\/em><\/p>\n<p><em>core.filemode=true<\/em><\/p>\n<p><em>core.bare=false<\/em><\/p>\n<p><em>core.logallrefupdates=true<\/em><\/p>\n<p><em>remote.origin.url=https:\/\/winsystech@bitbucket.org\/winsystech\/my-repo-test.git<\/em><\/p>\n<p><em>remote.origin.fetch=+refs\/heads\/*:refs\/remotes\/origin\/*<\/em><\/p>\n<p><em>branch.master.remote=origin<\/em><\/p>\n<p><em>branch.master.merge=refs\/heads\/master<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Now one need to use following command to change remote url to new one.<\/p>\n<p>$ git remote set-url origin <em>new_url<\/em><\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"566\"><em>[ec2-user@ip-172-31-88-185 .git]$ sudo git remote set-url origin https:\/\/winsystech@bitbucket.org\/winsystech\/my-repo.git<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>Now once remote path is changed move repository with the local system to new name to avoid any confusion.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"566\"><em>[ec2-user@ip-172-31-88-185 my-repo-test]$ cd ..<\/em><\/p>\n<p><em>[ec2-user@ip-172-31-88-185 ~]$ mv my-repo-test my-repo<\/em><\/p>\n<p><em>[ec2-user@ip-172-31-88-185 ~]$ ls<\/em><\/p>\n<p><em>my-repo<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>On the bit bucket side go to setting and rename the repository. And then clock on save repository details.<\/p>\n<p>&nbsp;<\/p>\n<p>After all the above operations use git pull to ensure both remote and local repository are communicating.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"566\"><em>[ec2-user@ip-172-31-88-185 ~]$ cd my-repo\/<\/em><\/p>\n<p><em>[ec2-user@ip-172-31-88-185 my-repo]$ sudo git pull<\/em><\/p>\n<p><em>Password for &#8216;https:\/\/winsystech@bitbucket.org&#8217;:<\/em><\/p>\n<p><em>Already up to date.<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>To help the readers one can follow step by step video tutorial on Cloud and tech tutorials at below link.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><iframe loading=\"lazy\" width=\"631\" height=\"355\" src=\"https:\/\/www.youtube.com\/embed\/uY5rmkmFUtM?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p>&nbsp;<\/p>\n\n<!-- Quick Adsense WordPress Plugin: http:\/\/quickadsense.com\/ -->\n<div class=\"2c935cf620b701aabbb7cc90bbf4023c\" data-index=\"2\" style=\"float: none; margin:0px 0 0px 0; text-align:center;\">\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<script>\r\n  (adsbygoogle = window.adsbygoogle || []).push({\r\n    google_ad_client: \"ca-pub-5554449970657557\",\r\n    enable_page_level_ads: true\r\n  });\r\n<\/script>\n<\/div>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">&nbsp; &nbsp; We will be today discussing the process of renaming the repository in Bit bucket or git using command line. We will make sure local copy and remote copy integrate with each other after renaming. You need to be either an organization owner or have admin permissions for the repository to rename it. First of we will login into&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"btn btn-default\" href=\"https:\/\/www.legendshub.com\/blog\/2019\/10\/01\/renaming-a-repository-bit-bucket\/\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[41],"tags":[113,114],"_links":{"self":[{"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/posts\/220"}],"collection":[{"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/comments?post=220"}],"version-history":[{"count":2,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/posts\/220\/revisions"}],"predecessor-version":[{"id":277,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/posts\/220\/revisions\/277"}],"wp:attachment":[{"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/media?parent=220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/categories?post=220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/tags?post=220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}