Migrate one or more projects from GitLab to GitHub.
- For developer instructions, see the developer README
# Example current versions, also known to work with earlier versions
$ node --version
v15.7.0
$ npm --version
7.4.3
$ npm run build
# set config
$ cp config/example.yml /path/to/my/config.yml
# update the config with appropriate values
# Set config directory path
$ export NODE_CONFIG_DIR="path-to-directory-containing-config"
# set appropriate config environment
$ export NODE_CONFIG_ENV="your_config_file_name"
$ gl2gh -h
$ gl2gh list my-foo-group
$ gl2gh list --starts-with my-foo-repo my-foo-group
$ gl2gh list -n 10 my-foo-group # n is defaulted to 50
$ gl2gh list --output text my-foo-group # output is defaulted to json
# copy repo to specific organisation under github
$ gl2gh copy-content my-foo-group --github-org my-bar-org
# copy repo to user root on github
$ gl2gh copy-content my-foo-group
# copy only matching repo(s)
$ gl2gh copy-content --starts-with my-repo my-foo-group
# copy example template as a starter
$ cp config/templates/branchProtectionTemplate.yml /path/to/my/branchProtectionTemplate.yml
# execute to configure branch protection rules
$ gl2h protect-branch -c /path/to/my/branchProtectionTemplate.yml my-foo-org my-foo-branch my-bar-repo
$ gl2h protect-branch -c /path/to/my/branchProtectionTemplate.yml my-foo-org my-foo-branch my-bar-repo-1 my-bar-repo-2 ...
$ gl2h auto-delete-head-branches my-foo-org my-bar-repo
$ gl2h auto-delete-head-branches my-foo-org my-bar-repo-1 my-bar-repo-2 ...
$ gl2h set-default-branch my-foo-org my-foo-branch my-bar-repo
$ gl2h set-default-branch my-foo-org my-foo-branch my-bar-repo-1 my-bar-repo-2
$ gl2h archive-repo my-project-path
$ gl2h archive-repo my-project-path-1 my-project-path-2 ...
$ gl2h create-webhook -c /path/to/my/webhookTemplate.yml my-project-path
$ gl2h create-webhook -c /path/to/my/webhookTemplate.yml my-project-path-1 my-project-path-2 ...
Clean up any installed binary for migration
$ npm run clean
- Navigate to your GitHub Personal access tokens
- Click
Generate new token
- Enter some text for
Note
and choose scopes:admin:repo_hook
(to configure webhooks on repositories)repo
(to configure repositories)
- Copy the generated token
- Navigate to your GitLab Personal access tokens
- Choose a name and expiry date, and choose scope:
api
- Copy the generated token
- The MIT License