https://github.com/caarlos0/fork-cleaner
Quickly clean up unused forks on your github account.
https://github.com/caarlos0/fork-cleaner
cleanup github-api golang
Last synced: 7 days ago
JSON representation
Quickly clean up unused forks on your github account.
- Host: GitHub
- URL: https://github.com/caarlos0/fork-cleaner
- Owner: caarlos0
- License: mit
- Created: 2016-10-08T23:01:45.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2025-03-14T08:37:34.000Z (about 1 month ago)
- Last Synced: 2025-03-31T23:37:28.512Z (14 days ago)
- Topics: cleanup, github-api, golang
- Language: Go
- Homepage:
- Size: 427 KB
- Stars: 335
- Watchers: 5
- Forks: 17
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
- charm-in-the-wild - fork-cleaner - Clean up old and inactive forks in your GitHub account. (_built with Bubble Tea_) (Applications / Development Tools)
- awesome-github-repos - caarlos0/fork-cleaner - Quickly clean up unused forks on your github account. (Go)
README
# fork-cleaner
[](https://github.com/caarlos0/fork-cleaner/releases/latest)
[](LICENSE.md)
[](https://github.com/caarlos0/fork-cleaner/actions?workflow=build)
[](https://goreportcard.com/report/github.com/caarlos0/fork-cleaner)
[](https://pkg.go.dev/github.com/caarlos0/fork-cleaner)
[](https://github.com/goreleaser)Quickly clean up old and inactive forks on your GitHub account.

## Installation
### Homebrew
```sh
brew install caarlos0/tap/fork-cleaner
```### snap
```sh
snap install fork-cleaner
```### apt
```sh
echo 'deb [trusted=yes] https://repo.caarlos0.dev/apt/ /' | sudo tee /etc/apt/sources.list.d/caarlos0.list
sudo apt update
sudo apt install fork-cleaner
```### yum
```sh
echo '[caarlos0]
name=caarlos0
baseurl=https://repo.caarlos0.dev/yum/
enabled=1
gpgcheck=0' | sudo tee /etc/yum.repos.d/caarlos0.repo
sudo yum install fork-cleaner
```### deb/rpm/apk
Download the `.apk`, `.deb` or `.rpm` from the [latest release](https://github.com/caarlos0/fork-cleaner/releases/latest) and install with the appropriate commands.
### Manually
Download the binaries from the [latest release](https://github.com/caarlos0/fork-cleaner/releases/latest) or clone the repository and build from source.
## Usage
You'll need to [create a personal access token](https://github.com/settings/tokens/new?scopes=repo,delete_repo&description=fork-cleaner) with `repo` and `delete_repo`
permissions. You'll need to pass this token to `fork-cleaner` with the `--token` flag.```sh
fork-cleaner --token ""
````fork-cleaner` will load your forked repositories, displaying the oldest first. This can take a little while as `fork-cleaner` will iterate over the page of forks and check the upstream repository's status (e.g. checking for active PRs).
## Troubleshooting
### Taking forever to load?
The app hits various endpoints in order to collect information on the upstream repository, this can take a while if you have a lot of forks. Setting `-skip-upstream=true` will skip checking commits, issues, PRs, etc on each upstream repository, potentially alleviating this issue.
### I've hit the rate limit.
You can check your current limits by calling GitHub's API:
```sh
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer " \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/rate_limit
```## Stargazers
[](https://starchart.cc/caarlos0/fork-cleaner)