- Note: this was originally supposed to make the labs private, until I realized you can't mark forked repos as private. Oh well. Was fun writing it.
- Thankfully, GitHub came out with the ability to archive repos, which is not as good, but better than nothing I guess...
- [Update Jan 2019]: GitHub has now added private repos to free accounts as well! The script has been updated accordingly. If you used the previous version of the script to archive your repos see the note below.
- [Transfer Repos API]: GitHub add preview API - transfer repos to new owner/organization here. The script has been updated to add this new feature.
This is a small script for Flatiron students who want to clean up their GitHub accounts by marking the Repos (e.g. Flatiron labs) as private (fork repos have to dublicate) or transfer repos to other oganization.
This script works by filtering your repos and looking for the SEARCH_TERM
flag from "Search input field", it will not privatize/transfer repos not containing the flag. If there are any repos you want to keep public/not transfer (for example, I know I wanted to keep my TTT with AI in my GitHub), you will have to manually go in to your GitHub account and change it back after running the script.
Before you start you will have to obtain a personal token from GitHub, you can get it by going here and clicking on the "Generate New Token" button, make sure to enable the "Repo" scope.
- Clone or download this repo
- Open up index.js
- Open up index.html in your browser
- Put your GitHub username and token in the appropriate fields
- Put the name of the GitHub org if you would like to transfer ownership
- Enter a search term which will serve as a unique identifier of the repos you want to mark private (this is unique per Flatiron track and should look something like
v-000
) - Click on the "Get List Of Repos" button
- Once the progress bar indicates you have all the repos (this may take a few minutes, you can open the browser console to get progress updates), all of the repos were retrieved and filtered. Click the "Make Private" or "Transfer Repos" button.
- Wait until you get the notification that all repos have been marked private or transfer.
- You also can go here to run the script.
If you used the previous version of this script to archive your repos, your repos are now read-only and there is no way to change that through GitHubs API (see the documentation under the archived
field).
Bug reports and pull requests are welcome in the GitHub repo or by email to contact@yechiel.me This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The script is available as open source under the terms of the MIT License.