On Mon, Sep 03, 2012 at 04:12:36PM +0200, Lukas Ocilka wrote:
> On 08/23/2012 05:52 PM, J. Daniel Schmidt wrote:
> >Sure, automating this makes a lot of sense, go ahead.
> >But don't forget to inform the team as otherwise somebody might push these
> >branches again.
> 
> Here's a possible way how to delete all the "broken" branches
> semi-automatically:
> 
> * Backup your SSH keys (~/.ssh)
> * Create a new SSH key without passphrase (ssh-keygen)
> * Add this *.pub key to https://github.com/settings/ssh
>   Now you can clone/push/fetch without entering the key
> * In each cloned directory, run my simple script to delete all the
>   "broken" branches
> * Remove the key from your system, remove it also from GitHub
> * Eventually restore your keys from backup
> 
> --- script (one line) ---
> for BRANCH in `git branch -a | grep "\/origin\/broken" | sed
> 's/.*origin\/broken/:broken/'`; do echo $BRANCH; git push origin
> $BRANCH; done
> --- script (one line) ---
> 
> Well, it's not an engineering gem but it does the job :) Feel free
> to enhance it.

Done:
https://github.com/yast/yast-meta/blob/master/github-scripts/remove-broken-branches

Yes, you can call me Lightning now.
-- 
Martin Vidner, Cloud & Systems Management Team
http://en.opensuse.org/User:Mvidner

Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu

Attachment: pgprV7NcJQqKL.pgp
Description: PGP signature

Reply via email to