Skip to content

Instantly share code, notes, and snippets.

View jmrborges05's full-sized avatar
🏠
Working from home

João Borges jmrborges05

🏠
Working from home
View GitHub Profile
@jmrborges05
jmrborges05 / delete_bitbucket_lfs_files.js
Created December 9, 2021 15:57 — forked from danielgindi/delete_bitbucket_lfs_files.js
Bulk delete Bitbucket LFS files
(() => {
// Run this in Chrome's console, while in Bitbucket's website and logged in
const csrftoken = document.cookie.match(/\bcsrftoken=(.*?)(?:;| |$)/)[1];
const repoName = window.__initial_state__.section.repository.currentRepository.full_name;
const expiry = 1000 * 60 * 60; // Delete only files older than an hour
let page = 1;
function iterateNext() {
fetch(`https://bitbucket.org/${repoName}/admin/lfs/file-management/?iframe=true&spa=0&page=${page}`, {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.