Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamsortiz/06c25cdfbfcf7b31441c85fce990f7b5 to your computer and use it in GitHub Desktop.
Save iamsortiz/06c25cdfbfcf7b31441c85fce990f7b5 to your computer and use it in GitHub Desktop.
Bitbucket mass clone and pull --all from project repos
# Given you are in a project repo list at bitbucket (https://bitbucket.org/account/user/????/projects/???
# Open the webbrowser console
# Paste code
# Ctrl+C on prompt
# Paste on a directory where you want all the clones + pulls
# Attribution for javascript clipboard: http://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript
var commands = "";
$('.repo-list--repo-name').each(function() {
var url_raw = $(this).attr('href');
var url = url_raw.substring(1,url_raw.length);
var reponame = $(this).html();
commands += "git clone git@bitbucket.org:" + url + ".git\n";
commands += "cd " + reponame + "\n";
commands += "git pull --all\n";
commands += "cd ..\n";
})
console.log(commands);
window.prompt("Copy to clipboard: Ctrl+C, Enter", commands);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment