Last active
May 31, 2016 11:52
-
-
Save iamsortiz/06c25cdfbfcf7b31441c85fce990f7b5 to your computer and use it in GitHub Desktop.
Bitbucket mass clone and pull --all from project repos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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