Mailinglist Archive: yast-devel (10 mails)

< Previous Next >
Re: [yast-devel] Disturbing branches at GitHub (broken/...)
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

* Backup your SSH keys (~/.ssh)
* Create a new SSH key without passphrase (ssh-keygen)
* Add this *.pub key to
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.


Yes, you can call me Lightning now.
Martin Vidner, Cloud & Systems Management Team

Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
< Previous Next >
Follow Ups