SysAdmin

Git – How to transfer or move repository between accounts

JJ
Jobin Joseph · Founder and CEO
·Published 23 August 2013·1 min read

Some times you may need to move your git repository to another account, even between providers such as, github.com, butbucket.org, gitlab.com or even to your own git server.

Pre-Requirements

Steps

git clone --bare git@github.com:oldaccount/my-old-repo.git
cd my-old-repo.git 
git push --mirror git@github.com:newaccount/my-new-repo.git 
cd .. 
rm -rf my-old-repo.git 

Thats it, Now go to the new repository and you can see each commits, branches, tags etc.

Note: This procedure can be used to transfer repos between two services too. ie from bitbucket to github or vise-versa.

Comment if found helpful 🙂

Hashtags : #git #github #bitbucket

Jobin Joseph
Jobin Joseph, Founder and CEO
5x AWS Certified, ISO 27001:2022 Lead Implementer, 17+ years building cloud infrastructure for regulated industries.
About Jobin →

Reading this because your AWS bill or uptime is a problem?

30 minutes, direct with the founder, no sales pitch: one specific recommendation for your AWS workload.

Book a free 30-minute review
30 min Free Consultation →