A utility to batch transfer GitHub repositories from one organization or user to another.
Transfer repositories using an interactive wizard or manually edit a generated CSV file, including the ability to assign existing teams.
Set a Personal Access Token either as a Codespaces secret or in a .env
file when running locally.
Name | Value | Required |
---|---|---|
TOKEN |
A repo , read:org scoped Personal Access Token |
true |
💡 Make sure you're an org owner for both source and destination organizations.
💡 Your personal user account will show up first in the list of available organizations.
💡 As every repository transfer sends an email to the repository owner you may want to use a machine user with separate email instead to avoid a full mailbox.
Choose between running in a Codespace, Docker or Node.
- Fork or clone the repository
- Set your Personal Access Token as a Codespaces secret
- Create a codespace for your repository
cp .env.example .env
npm install
# terminal 1
docker build -t repo-transfer-utility .
docker run -it repo-transfer-utility npm start
# terminal 2
docker container ls
docker exec -it <container-id> /bin/sh
vi repos.csv # (edit generated CSV when using manual mode)
cp .env.example .env
npm install
npm start
graph TD;
A(Begin the transfer process by retrieving the available organizations)-->|start/abort|B
B(Select a source organization to transfer repositories from)-->|list select|C
C(Select a destination organization to transfer repositories to)-->|list select|D
D(Choose your transfer method)
D-->|use the interactive transfer wizard|F
F(Select repositories to transfer)-->|checkbox select|G
D-->|manually edit a generated CSV file|G
G(Select the destination org teams you want to assign to the repos)-->|checkbox select|H
H(Press confirm to continue or abort to quit)-->|confirm/abort|I
I(Are you really sure you want to transfer X repositories from Org X to Org Y?)-->|confirm/abort|J
H-->|confirm/abort|K
K(CSV file is generated, edit the CSV and press confirm when done)-->|confirm/abort|L
L(Are you really sure you want to transfer X repositories?)-->|confirm/abort|J
J(Transfer repositories)
repo,source org,destination org,[team ids]