我想知道是否可以从 git 以来从 bitbucket 克隆团队中的所有存储库。
提前致谢。
最佳答案
我已经编好了 this tiny Ruby script 。测试它并 从 echo
调用中删除 system()
以实际执行克隆 。
#!/usr/bin/env ruby
# USAGE: ./clone ORG_NAME
# ( ./clone instedd )
require 'open-uri'
require 'json'
team = ARGV[0] || raise("Must specify organization name")
puts "Fetching https://bitbucket.org/!api/1.0/users/#{team}..."
data = JSON.parse(open("https://bitbucket.org/!api/1.0/users/#{team}").read)
data["repositories"].each do | repo |
# delete "echo" for _actually_ cloning them
system("echo #{repo["scm"]} clone https://bitbucket.org/#{team}/#{repo["slug"]}")
end
关于git - 如何使用 GIT 从 Bitbucket 将所有存储库克隆到 Team,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/21313420/