Skip to content

jabyess/github-migrate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Github Migration Script

Set Up

Clone this repo, then

 $ cd github-migrate
 $ npm install
  • Create a personal access token https://github.com/settings/tokens. Make sure to give yourself appropriate permissions (like delete if you want to delete stuff).
  • Copy .env.sample to a new file, .env, in the root dir.
  • Fill out the appropriate values.
  • Guide for values:
name description
org_name Either your github username, or the github organization name that you want to clone into.
github_url https://github.com or your github enterprise url.
token the personal access token you created earlier.
  • No trailing slashes on urls.
  • Fill out the links.json file. Each repo you want to clone from goes in there. You must use the clone urls, with .git at the end. Works with https, haven't tested with ssh.

Usage

TO DELETE EVERY REPO IN THE SPECIFIED ORGANIZATION/USER

node migrate.js delete

Note: you must have given yourself delete permissions in your personal access token.

Clone from links.json to the specified organization/user

node repo.js clone

If you are prompted for your github username and password, enter them. You should only have to do this once, since they will be cached.

Notes

This script should work and migrate all branches. Sometimes refs break or cause merge conflicts.

I take no responsibility if you blow away stuff and lose all your work.

Shoutout to @superbuggy for figuring out all the multi-branch shenanigans.

About

Migrate repos to a user or organization.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published