summaryrefslogtreecommitdiff
path: root/_posts/2009-06-25-moving-a-repo.textile
blob: 060a05416b486ff904b5b6e045ea3455592d5007 (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
---
layout: default
title: Moving a repo
description: How to move a repo from one account to another
categories: repos
---

This guide details the process of moving a repo to another account and transferring the network of forked repos.

h2. Creating a new repo

The first step to moving a repo is to create a new repo on the target account.  If your current repo is public, you can simply fork the repo while logged into the target account.  If the repo is private, you will need to create a new private repo on the target account to push to.

h2. Creating a mirror

p(. _If you forked this step is not necessary, but you may still do it for good measure._

To create a complete mirror that includes all branches and tags, you need to do a bare-clone followed by a mirror-push:

<pre class="terminal">git clone --bare git@github.com:myaccount/my-old-repo.git
cd my-old-repo
git push --mirror git@github.com:mycompany/our-new-repo.git
cd ..
rm -rf my-old-repo</pre>

h2. Reparenting forks

If your original repo has forks that you wish to reparent to the new repo, please "file a support ticket":http://support.github.com/.
*Do not delete the original repo until the reparenting is complete!*

h2. Collaborators

If your original repo had collaborators, they will not be copied.  You will need to add each user as a collaborator on the new repo.