This is just a hack to transfer repositories between users or GitHub organizations. It was created because the current API does not support transfer of repositories.
Use this at your own risk. Currently this package moves all public repositories to destination user, unless specified condition ONLY_FORKS equal to true. Private repositories aren't affected. If you want to customize which repositories are moved, change the repositories variable in the spec/github.rb file. Probably around this part:
if ['true', 1, true].include?(GITHUB[:only_forks])
repositories = repositories.select do |repo|
repo[:fork]
end
end- Ruby 2.2+
- Mozilla's geckodriver. If you use Mac OS and have
brew, runbrew install geckodriver. - rspec
- You need to disable Two-Factor authentication on Github for this to work
- GitHub's: username, password and access token. It is recommended to create a new personal token and delete it afterwards.
- Copy the
.env.exampleto.env - Fill the
.envfile with the required fields, (remember, 2FA should be disabled).GITHUB_USER_TO_MOVE_REPOSITORIES_FROMandGITHUB_USER_TO_MOVE_REPOSITORIES_TOreceives the username, not the profile URL.ONLY_FORKSfilters the repositories to transfer only forks - Run
bundle install - Run
rspec spec/github.rbon the root folder of this project
The .env files are not tracked by default in this repository, do not put your data inside .env.example and push it. Change your password before and after the usage of this package.
Already cloned repositories may give you a permission error when trying to push because it is trying to access the previous URL for the repository, to update on your local clone, run:
$ git remote --set-url http://github.com/{my-org}/{repository-name}
This repository is covered under the MIT license