Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

move a private github repo to a new account

Tags:

github

I created a new github account, and I want to move a private repo from an old account to my new account, and it's important to maintain all histories. After that I want to delete the repo in the old account.

e.g.

existing github account: old-user
existing private repo under the account old-user: myrepo
new github account: new-user

what should I do?

like image 803
user342673 Avatar asked Feb 24 '13 08:02

user342673


People also ask

How do I migrate a repo from one account to another?

If you're using Git, you'll first need to clone the repo you want to copy locally. Then, create a new empty repository in the account you want to add the repo. Finally, add your remote and push the files from the local repo to the new Beanstalk account using the git push command.

Are GitHub private repos really private?

Privacy and data sharingPrivate repository data is scanned by machine and never read by GitHub staff. Human eyes will never see the contents of your private repositories, except as described in our Terms of Service.

How do I transfer ownership of a GitHub account?

In the left sidebar, click GitHub Apps. Select the GitHub App whose ownership you want to transfer. In the left sidebar, click Advanced. Click Transfer ownership.


1 Answers

First, check the GitHub transfer page:

Transferring between user accounts

  • Open the repo's page
  • Select "Settings" from the repository action bar enter image description here
  • Click the "Transfer" button enter image description here

The other option, if you have your repo cloned locally, is to:

git push --mirror [email protected]:NewUsername/newProject.git
like image 53
VonC Avatar answered Sep 26 '22 07:09

VonC