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.
node migrate.js delete
Note: you must have given yourself delete permissions in your personal access token.
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.
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.