blob: a757587ab2505c6a200b62a4bcb805a6e21bfe3e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
---
layout: default
title: Move a repo
description: How to move a repo from one account to another
categories: beginner
---
This guide details the process of moving a repo to another account.
Direct move
-----------
You can transfer ownership of a repository you own in the Admin page of your repository. For example https://github.com/amiridis/playground/admin. There you can find the following section:

Existing forks
--------------
If a fork of the repo you wish to move already exists on the target account, you can [contact support](https://github.com/contact) to have the roots switched. Note that deleting the root repo will either delete all forks if the repo is private, or automatically pick a new root if the repo is public. You cannot pick which repo will become the root, so please contact support if you want a specific repo to become the new root.
Note that if the repo is private the new owner will need a paid plan to support the repo. Issues, wikis, pages, commits comments and non-repo downloads **will not** be transferred to the new root. Make sure you do not delete your old repo if you have any of these you wish to keep.
Manual clone and push
---------------------
If you have a repo on an external server that you wish to move to GitHub, you can move it with a special clone and push. This method will create an exact mirror of the repo into the new repo.
First, create a new repo on the target account. Next, create a mirror that includes all branches and tags. To do this you need to do a bare-clone followed by a mirror-push:
<pre class="terminal">
git clone --bare url/for/my-old-repo.git
cd my-old-repo.git
git push --mirror git@github.com:mycompany/my-new-repo.git
cd ..
rm -rf my-old-repo.git
</pre>
|