Skip to content

A CLI tool to bulk cleanup GitHub profiles by syncing and privatizing forks (handles archived repos).

License

Notifications You must be signed in to change notification settings

NeelPatra/github-profile-cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

GitHub Profile Cleaner ๐Ÿงน

Automate the cleanup of your GitHub profile by syncing and privatizing old forks in bulk.

License

โš ๏ธ The Problem

Forking repositories is great for open source contribution, but over time, your profile gets cluttered with dozens of abandoned forks. This hides your actual original projects from recruiters and visitors.

โœ… The Solution

This tool uses the GitHub CLI (gh) to safely tidy up your profile:

  1. Safety Filter: Identifies only forks (keeping your original creations safe).
  2. Sync: Updates the forks with the latest code from the original author.
  3. Unlock & Hide: Automatically unarchives "locked" repositories so they can be modified.
  4. Privatize: Moves them to private visibility to clean up your profile.

๐Ÿ› ๏ธ Installation

1. Install GitHub CLI (Critical Step!)

You must install the official GitHub CLI tool.

๐Ÿ”ด DO NOT use npm install gh (This installs an unrelated, broken package that will cause errors).

๐ŸŸข USE THIS INSTEAD:

  • Windows: winget install --id GitHub.cli
  • Mac: brew install gh
  • Linux: sudo apt install gh

2. Login

Authenticate with your GitHub account:

gh auth login

๐Ÿš€ How to Use

  • Download the clean.sh file from this repository.
  • Open your terminal (Git Bash, PowerShell, or Terminal).
  • Run the script:
sh clean.sh
  • Review the list: The script will show you exactly which repos will be moved.
  • Confirm: Type y to start the cleanup.

๐Ÿง  For Power Users (The One-Liner)

If you prefer running a single command without downloading the script:

gh repo list --fork --visibility public --limit 1000 --json nameWithOwner --jq '.[].nameWithOwner' | xargs -I {} sh -c 'gh repo sync {} || true; gh repo unarchive {} --yes; gh repo edit {} --visibility private --accept-visibility-change-consequences'

๐Ÿ“œ License

This project is open-source and available under the MIT License.

About

A CLI tool to bulk cleanup GitHub profiles by syncing and privatizing forks (handles archived repos).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages