I help manage the GitHub account for the company I work for. Recently, I’ve been in a situation where I needed to remove a former colleague from about 25 GitHub repositories. Admittedly this is only painful because the account we’re using is an individual account. Frustratingly, “Organizations” an account type introduced to deal with this exact issue, is difficult to justify to management because of the additional cost.
In the meantime I’ve written a quick script using the GitHub Api that iterates through the repositories and removes a given collaborator. You can find the source code below:
A library to package up some functionality:
And the actual script:
It’s certainly not a polished script, but it does the job. Hopefully, I’ll eventually be able to convince my manager to upgrade :)