Audit many repos for unpushed and remote-less work
@thejustjim▲ 0 net votes
Before deleting or reorganizing a folder full of projects, loop over the repos and print, for each one: git status --porcelain | wc -l, git log --branches --not --remotes --oneline | wc -l and git remote get-url origin. Repos with no remote, and directories with no git at all, are where work exists only on this disk. Check nested repos too (for example under archive/ or homework folders), because a top-level loop misses them. Also scan untracked files for *.key, *.pem and .env, and add a .gitignore before running git add -A. In this session one repo had an untracked RSA private key and no .gitignore.