Renaming a repository (Bit bucket)

 

 

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 the server we have cloned our repo. Make sure we are in the working copy.

[ec2-user@ip-172-31-88-185 my-repo-test]$ cd ..

[ec2-user@ip-172-31-88-185 ~]$ ls

my-repo-test

[ec2-user@ip-172-31-88-185 ~]$ pwd

/home/ec2-user

 

 

 

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.

[ec2-user@ip-172-31-88-185 ~]$ cd my-repo-test/

[ec2-user@ip-172-31-88-185 my-repo-test]$ ls -latr

total 4

-rw-r–r– 1 root     root      39 Sep 22 15:19 README.md

drwxr-xr-x 3 root     root      35 Sep 22 15:19 .

drwx—— 4 ec2-user ec2-user 110 Sep 22 15:31 ..

drwxr-xr-x 8 root     root     198 Sep 22 15:33 .git

 

 

Change the directory to .git look for config file and open the file. Alternatively one can run config command to view remote commit location.

[ec2-user@ip-172-31-88-185 my-repo-test]$ cd .git/

[ec2-user@ip-172-31-88-185 .git]$ ls -ltr

total 28

drwxr-xr-x 2 root root  21 Sep 22 15:19 info

drwxr-xr-x 2 root root 301 Sep 22 15:19 hooks

-rw-r–r– 1 root root  73 Sep 22 15:19 description

drwxr-xr-x 2 root root   6 Sep 22 15:19 branches

drwxr-xr-x 7 root root  60 Sep 22 15:19 objects

drwxr-xr-x 5 root root  46 Sep 22 15:19 refs

-rw-r–r– 1 root root 114 Sep 22 15:19 packed-refs

drwxr-xr-x 3 root root  30 Sep 22 15:19 logs

-rw-r–r– 1 root root 137 Sep 22 15:19 index

-rw-r–r– 1 root root  23 Sep 22 15:19 HEAD

-rw-r–r– 1 root root 285 Sep 22 15:32 config

-rw-r–r– 1 root root 107 Sep 22 15:33 FETCH_HEAD

-rw-r–r– 1 root root  41 Sep 22 15:33 ORIG_HEAD

[ec2-user@ip-172-31-88-185 .git]$ cat config

[core]

        repositoryformatversion = 0

        filemode = true

        bare = false

        logallrefupdates = true

[remote “origin”]

        url = https://winsystech@bitbucket.org/winsystech/my-repo-test.git

        fetch = +refs/heads/*:refs/remotes/origin/*

[branch “master”]

        remote = origin

        merge = refs/heads/master

[ec2-user@ip-172-31-88-185 .git]$ git config -l

core.repositoryformatversion=0

core.filemode=true

core.bare=false

core.logallrefupdates=true

remote.origin.url=https://winsystech@bitbucket.org/winsystech/my-repo-test.git

remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*

branch.master.remote=origin

branch.master.merge=refs/heads/master

 

 

Now one need to use following command to change remote url to new one.

$ git remote set-url origin new_url

[ec2-user@ip-172-31-88-185 .git]$ sudo git remote set-url origin https://winsystech@bitbucket.org/winsystech/my-repo.git

 

Now once remote path is changed move repository with the local system to new name to avoid any confusion.

[ec2-user@ip-172-31-88-185 my-repo-test]$ cd ..

[ec2-user@ip-172-31-88-185 ~]$ mv my-repo-test my-repo

[ec2-user@ip-172-31-88-185 ~]$ ls

my-repo

 

 

On the bit bucket side go to setting and rename the repository. And then clock on save repository details.

 

After all the above operations use git pull to ensure both remote and local repository are communicating.

[ec2-user@ip-172-31-88-185 ~]$ cd my-repo/

[ec2-user@ip-172-31-88-185 my-repo]$ sudo git pull

Password for ‘https://winsystech@bitbucket.org’:

Already up to date.

 

To help the readers one can follow step by step video tutorial on Cloud and tech tutorials at below link.

 

 

 


Amrit Pal singh

Designing critical migration from legacy to cloud environments, extending devops approach into analytics, AI/ML to maximize the purpose of agile approach. We work to integrate compliance with risk, security and regulations, building seamless interfaces across multiple systems. I am fortunate to manage complex hierarchy of global portfolios, programs and projects and executive communication . Provide TCO analyses to low level architecture, design and implementation, readiness and building BCP/DR/HA, and around the clock monitoring & management using cloud tools relevant to our customer's situation and objectives.

  11 comments for “Renaming a repository (Bit bucket)

  1. Bhumi
    October 3, 2019 at 12:10 pm

    Thanks for sharing this information…

  2. rardTag
    November 3, 2019 at 5:20 am

    hi 🙂 bross 🙂

    • Bhumi Patel
      December 12, 2019 at 8:26 am

      Hello

  3. ftpgamehouse lucys expedition full episodes
    January 16, 2020 at 3:45 pm

    I love it when folks get together and share ideas. Great website, keep it up!| а

  4. dvd simon garfunkel the concert in central park download
    January 23, 2020 at 8:49 pm

    Thank you, I have recently been searching for information approximately this subject for a while and yours is the greatest I’ve came upon so far. But, what concerning the bottom line? Are you positive about the source?| а

  5. Myltew
    February 1, 2020 at 8:04 pm

    Homemade PP cakes in Kazan

  6. KRenokes
    February 18, 2020 at 4:37 am

    Our company are will swiftly as well as effectively produce a guarantee Premium redesign New York.

    Our experts consistently preserve and also improve the warehouse of extra parts and also company records for working repair service as well as maintenance.

    Also in our company, you can buy personalized shower room narcissism, basement renovations on the very best ailments. Along with us, Inside renovations New York, and also Premium makeover Manhattan, will certainly come to be easy, top quality and also fast.

  7. Stephennot
    February 21, 2020 at 1:37 pm

    Hello!
    Dissertation Help Services We understand the hassle that can be involved in dissertation writing. Need write my dissertation help? Get in touch with us!

    definition essay help
    essay writing company reviews

  8. polftmdok
    March 2, 2020 at 10:55 pm

    does not work

  9. March 27, 2020 at 12:02 pm

    quite a year
    _________________
    Viva casino praha

  10. MartinCer
    June 22, 2020 at 3:06 pm

    It is very nice to read your site, thank you very much for your work, it’s great!

Leave a Reply

Your email address will not be published.