How to unwatch multiple repos easily on github?

Solution 1:

For the lazy, one can do this without the API reasonably quickly at this url: https://github.com/watching

A clean simple list, click click click click.

Additionally, there's a box that is golden. Uncheck it to not automatically be set to watch all repos you're given push access to. Hooray for managing the signal to noise ratio.

Solution 2:

Native JS version of a previous answer. Navigate to https://github.com/watching and then run:

Oneliner:

Array.prototype.slice.apply(document.querySelectorAll('.js-subscription-row')).forEach(el => { const org = el.querySelector('a[href^="/YOUR_ORG"]'); if (org) el.querySelector('button').click()})

Unwrapped:

const org = 'YOUR_ORG'
const query = document.querySelectorAll('.js-subscription-row')
const rows = Array.prototype.slice.apply(query)
rows.forEach(function (el) {
  const org = el.querySelector('a[href^="/' + org + '"]')
  if (org) el.querySelector('button').click()
})

Solution 3:

Organisation specific

If you just want to unwatch repos from a single organisation, you can use this from https://github.com/watching

$('.js-subscription-row').each(function(){ var isYourOrganisation = $(this).find("a[href^='/YOUR_ORG']"); if(isYourOrganisation.length){ $(this).find('button:contains("Unwatch")').click(); } });

Substitute YOUR_ORG with whatever your organisation is called.

Solution 4:

Github has an API. You could write a script to do this using Github's API, particularly the part that deals with watching repos.