{"id":16220398,"url":"https://github.com/mortonfox/githubtools","last_synced_at":"2026-03-01T23:32:44.373Z","repository":{"id":66340875,"uuid":"51980696","full_name":"mortonfox/githubtools","owner":"mortonfox","description":"Misc tools for github","archived":false,"fork":false,"pushed_at":"2025-12-30T20:07:45.000Z","size":73,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T18:21:17.952Z","etag":null,"topics":["backup","backup-gists","download","downloader","github","github-api","github-backup","githubtools"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mortonfox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-02-18T05:07:29.000Z","updated_at":"2025-12-15T19:32:52.000Z","dependencies_parsed_at":"2024-05-29T01:27:54.987Z","dependency_job_id":null,"html_url":"https://github.com/mortonfox/githubtools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mortonfox/githubtools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortonfox%2Fgithubtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortonfox%2Fgithubtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortonfox%2Fgithubtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortonfox%2Fgithubtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mortonfox","download_url":"https://codeload.github.com/mortonfox/githubtools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortonfox%2Fgithubtools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29987698,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T22:42:38.399Z","status":"ssl_error","status_checked_at":"2026-03-01T22:41:51.863Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","backup-gists","download","downloader","github","github-api","github-backup","githubtools"],"created_at":"2024-10-10T11:58:36.872Z","updated_at":"2026-03-01T23:32:44.355Z","avatar_url":"https://github.com/mortonfox.png","language":"Ruby","readme":"# githubtools\n\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n* [Introduction](#introduction)\n* [Installation](#installation)\n    * [Set up OAuth app](#set-up-oauth-app)\n    * [Set up config file](#set-up-config-file)\n* [Usage](#usage)\n    * [github\\_friends](#github_friends)\n    * [latest\\_rel](#latest_rel)\n    * [backup\\_gists](#backup_gists)\n    * [backup\\_repos](#backup_repos)\n    * [search\\_and\\_del](#search_and_del)\n\n\u003c!-- vim-markdown-toc --\u003e\n\n## Introduction\n\ngithubtools is a set of scripts to do simple things with Github. Currently, these are as follows:\n\n* github\\_friends.rb: This script sorts your Github followers and following into 3 categories: mutual follows, only followers, and only following.\n* latest\\_rel.rb: This script shows a bit of information about the latest releases from the specified repositories.\n* backup\\_gists.rb: Downloads all of a user's gists, ready for backup.\n* backup\\_repos.rb: Downloads all of a user's repositories. Produces a git bundle and a zip file for each repository.\n* search\\_and\\_del.rb: Search for fork repos with names matching the given string and offer to delete them.\n\n## Installation\n\nGet the repo:\n\n```sh\ngit clone git@github.com:mortonfox/githubtools.git\ncd githubtools\n```\n\nInstall gems:\n\n```sh\nbundle install\n```\n\n### Set up OAuth app\n\nGo to \u003chttps://github.com/settings/developers\u003e and click on \"New OAuth App\".\n\nEnter the following:\n\n* Application name: githubtools\n* Homepage URL: http://github.com/mortonfox/githubtools\n* Authorization callback URL: http://localhost:3501/callback\n\nClick on \"Generate a new client secret\".\n\nSave both the Client ID and Client Secret for later.\n\n### Set up config file\n\nCreate a new file ``~/.githubtools.conf`` with the following content:\n\n```\nport = 3501\ntoken_file = \"~/.githubtools.token\"\nclient_id = CLIENT_ID\nclient_secret = CLIENT_SECRET\n```\n\nWhere CLIENT_ID and CLIENT_SECRET are the Client ID and Client Secret you saved earlier.\n\n## Usage\n\n### github\\_friends\n\nRun the script with a username as the first argument. For example:\n\n```sh\nbundle exec ./github_friends.rb mortonfox\n```\n\nYou can control what this script outputs using the -m, -r, and -o options:\n\n```console\n$ bundle exec ./github_friends.rb -h\nUsage: github_friends.rb [options] username\n    -h, -?, --help                   Option help\n    -m, --mutual                     Show mutual friends\n    -r, --only-friends               Show only-friends\n    -o, --only-followers             Show only-followers\n        --auth                       Ignore saved access token and force reauthentication\n        --config-file=FNAME          Config file name. Default is /home/pcheah/.githubtools.conf\n  If none of -m/-r/-o are specified, display all 3 categories.\n```\n\n### latest\\_rel\n\nRun the script with one or more Github repos as the arguments. This will give you a one-line-per-repo summary of the latest release from each repo. For example:\n\n```console\n$ bundle exec ./latest_rel.rb brave/browser-laptop brave/browser-android\nbrave/browser-laptop: v0.7.16 Dev Channel at 2016-02-24 16:10\nbrave/browser-android: v1.9.0 at 2016-02-24 19:53\n```\n\nIf you add the ``-l`` switch, the script adds information on available downloads. For example:\n\n```console\n$ bundle exec ./latest_rel.rb -l brave/browser-laptop brave/browser-android\nbrave/browser-laptop: v0.7.16 Dev Channel at 2016-02-24 16:10\n    * Brave-Linux-x64.tar.bz2 (61.19 MB): https://github.com/brave/browser-laptop/releases/download/v0.7.16dev/Brave-Linux-x64.tar.bz2\n    * Brave.dmg (79.21 MB): https://github.com/brave/browser-laptop/releases/download/v0.7.16dev/Brave.dmg\n    * BraveSetup.exe (94.26 MB): https://github.com/brave/browser-laptop/releases/download/v0.7.16dev/BraveSetup.exe\n    * tarball: https://api.github.com/repos/brave/browser-laptop/tarball/v0.7.16dev\n    * zipball: https://api.github.com/repos/brave/browser-laptop/zipball/v0.7.16dev\n\nbrave/browser-android: v1.9.0 at 2016-02-24 19:53\n    * LinkBubble-playstore-release.apk (3.32 MB): https://github.com/brave/browser-android/releases/download/v1.9.0/LinkBubble-playstore-release.apk\n    * tarball: https://api.github.com/repos/brave/browser-android/tarball/v1.9.0\n    * zipball: https://api.github.com/repos/brave/browser-android/zipball/v1.9.0\n\n```\n\nFor usage info:\n\n```console\n$ bundle exec ./latest_rel.rb -h\nUsage: latest_rel.rb [options] owner/repo [owner/repo ...]\n    -h, -?, --help                   Option help\n    -l, --long                       Long format\n    -d, --debug                      Debug mode\n```\n\n### backup\\_gists\n\nRun this script with a username as the first argument. The script will do the following:\n\n* Create a folder named gists.\n* git clone each of the user's gists under that folder.\n\n### backup\\_repos\n\nRun this script with no argument to backup the authenticated user's repos. This mode of operation will back up both public and private repos.\n\nRun this script with a username as the first argument to backup that user's public repos.\n\nThe script will do the following:\n\n* Create a folder named repos.\n* git clone each of the user's repositories, excluding forks of other repositories.\n* Create a git bundle for each repository.\n* Use git archive to create a zip file of each repository.\n* Delete the cloned repositories.\n\n### search\\_and\\_del\n\nUse this script to clean up unnecessary fork repos. Usually, it's okay to delete a fork after the pull request has been merged. You may also delete the fork before the pull request has been merged but you'll need [a workaround to resurrect the pull request](https://github.com/isaacs/github/issues/168#issuecomment-374201226) if you wish to continue working on it. So use this script *at your own risk*.\n\nRun this script with a search string as the first argument. The script will look for fork repos matching the search string and offer to delete them. If there are fork repos that you with to exclude from this search, add \"#keep\" to their descriptions.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmortonfox%2Fgithubtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmortonfox%2Fgithubtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmortonfox%2Fgithubtools/lists"}