What Gets Created
When you run achievements, the CLI creates:- Branches: Temporary feature branches (e.g.,
pair-extraordinaire-1,pull-shark-2) - Commits: Multiple commits on each branch
- Pull Requests: PRs for each operation (later merged and closed)
- Issues: For Quickdraw achievement
- Discussions: For Galaxy Brain achievement
For most achievements, you might run 10-1024 operations, resulting in thousands of commits in your repository’s history.
Reset Repo History Feature
The CLI includes a built-in Reset Repo History feature that squashes all commits into a single clean commit.How It Works
Git Orphan Branch Strategy
Git Orphan Branch Strategy
The reset feature uses Git’s orphan branch strategy:
- Creates a new orphan branch (
clean-slate) with no history - Stages all current files
- Creates a single “Initial commit”
- Deletes the old
mainbranch - Renames
clean-slatetomain - Force pushes to the remote repository
src/app/screens/ResetHistoryScreen.tsx:38-58:What Gets Preserved
What Gets Preserved
- ✅ All current files in the repository
- ✅ Current code state
- ✅ Repository settings
- ❌ Commit history (squashed to one commit)
- ❌ Branch references (reset to new history)
What Remains on GitHub
What Remains on GitHub
Even after resetting commit history:
- ✅ Pull requests remain visible
- ✅ Issues remain visible
- ✅ Discussions remain visible
- ✅ All are still listed in your GitHub contribution graph
Using Reset Repo History
Confirm the operation
Type
y or select Yes to confirm.The CLI will:- Create an orphan branch
- Stage all files
- Create a clean commit
- Replace the main branch
- Force push to GitHub
What Happens During Reset
The reset operation follows this sequence:Manual Git Reset (Alternative)
If you prefer to reset manually without the CLI:Cleaning Up Branches
Most branches are automatically deleted after PRs are merged, but you can verify:Check for Remaining Branches
main(local)remotes/origin/main(remote)
Delete Local Branches
If you see leftover achievement branches:Delete Remote Branches
Check for remote branches:Deleting and Recreating the Repository
To completely clear PR history from your GitHub profile, you must delete and recreate the repository.Delete the repository on GitHub
- Go to your repository on GitHub
- Click Settings
- Scroll to the bottom to the “Danger Zone”
- Click Delete this repository
- Type the repository name to confirm
- Click I understand the consequences, delete this repository
Create a new repository with the same name
- Go to github.com/new
- Enter the exact same repository name
- Choose public or private (same as before)
- Do NOT initialize with README (if you want to push your backup)
- Click Create repository
What This Clears
- ✅ All commit history
- ✅ All pull requests (no longer visible)
- ✅ All issues (no longer visible)
- ✅ All discussions (no longer visible)
- ✅ All activity from contribution graph
What This Preserves
- ✅ Repository name and URL
- ✅ Current code/files (if you pushed them)
- ❌ Stars, watchers, forks (these are lost)
- ❌ Settings (must reconfigure)
Your achievement badges remain on your profile! GitHub’s achievement system tracks that you earned them, even if the repository is deleted.
Best Practices for Cleanup
Immediate Cleanup
After running achievements:- ✅ Wait for achievements to appear on your profile (can take a few minutes)
- ✅ Use Reset Repo History to squash commits
- ✅ Keep the repository if you might run more achievements later
Deep Cleanup
If you’re done with achievements and want a completely clean slate:- ✅ Verify achievements appear on your profile
- ✅ Use Reset Repo History first
- ✅ Wait 24 hours (ensures GitHub’s systems have registered achievements)
- ✅ Delete and recreate the repository
- ✅ Revoke access tokens if no longer needed
Keep for Reference
If you want to keep a record:- ✅ Don’t delete the repository
- ✅ Use Reset Repo History to clean commit history
- ✅ Archive the repository (Settings > Archive this repository)
- ✅ This keeps PRs/issues visible but marks the repo as read-only
Cleaning Up Other Resources
Access Tokens
After you’re done with achievements:Revoke main account token
- Go to Settings > Developer settings > Personal access tokens
- Find your “GitHub Achievement CLI” token
- Click Delete
Revoke helper account token
- Log in as helper account
- Go to Settings > Developer settings > Personal access tokens
- Find the helper token
- Click Delete
Local Database
Clean up local progress tracking:Helper Account
Decide whether to keep or delete: Keep if:- You might run achievements again
- You want to help others earn achievements
- You might use it for testing GitHub features
- You’re done with achievements permanently
- You don’t want to maintain another account
Troubleshooting Reset Issues
”Failed to delete old main branch”
Problem: The old main branch can’t be deleted.Solution:
“Push rejected: protected branch”
Problem: Branch protection rules prevent force pushing.Solution:
- Go to repository Settings > Branches
- Temporarily remove branch protection rules
- Run the reset operation
- Re-enable branch protection after completion
”Push failed: permission denied”
Problem: Your token lacks push permissions.Solution:
- Verify your
GITHUB_TOKENhas thereposcope - Regenerate the token if necessary
- Update
.envwith the new token
”Working directory is not clean”
Problem: Uncommitted changes in the repository.Solution: