#no-code-left-behind
This repository includes a scripts for archiving code from GitHub a GitHub Fork.
- Ex-member - a GitHub user, who was at one point a member of a GitHub Organisation, but has subsequently left
- Orphaned Fork - a fork of a private repository by an Ex-member of the organisation
- Archive Member - a stub account within the organisation with the intention of owning the code from the orphaned fork
###Process
- Create an archive member of the organisation
- For each orphaned fork
- As the archive member, create a fork of the source repository (if the fork doesn't already exist)
- Clone the archive fork repository to create a local copy
- Add a remote for the orphaned fork
- Fetch the changes from the orphaned fork to the local repository
- For each (branch|tag) in the orphaned fork
- Create a local branch called {ex-member}_{branch} (e.g.seeya_master, seeya_feature/whizzy, etc )
- Push the {ex-member}_{branch} to the mock member fork
- Delete the orphaned fork
###Comments
- The script is expected to be run as the archive member (with an OAuth token for the user)
- The login and a generated OAuth Token need to be supplied in the config/configuration.yml under the section
- The deletion of the forks is to be done by the user. A URL to the deletion element will be displayed
- Deletion will only be recommended when all forks are merged
- There are a couple of problems with timing
- The GRIT gem adds a timeout to Git commands - this may get exhausted - I've not been able to reliably work out the timing. In most cases running again with a longer timeout (
-t timeout
) will fix the issue
- The GRIT gem adds a timeout to Git commands - this may get exhausted - I've not been able to reliably work out the timing. In most cases running again with a longer timeout (
- Clone
bundle install
The configuration.yml
file should be completed with the access details for the nominated archive user.
The script can be initiated by running
$ bundle exec ruby scripts/archive_fork.rb [forks]
the following arguments exist:
- -f {filename} - a newline separated list of forks to process
- -t {timeout} - what timeout to set for git commands