Skip to content

Instantly share code, notes, and snippets.

@nicklegr
Created December 14, 2014 09:38
Show Gist options
  • Select an option

  • Save nicklegr/15f812600bf98f1becaa to your computer and use it in GitHub Desktop.

Select an option

Save nicklegr/15f812600bf98f1becaa to your computer and use it in GitHub Desktop.
gitリポジトリをbitbucketに一括push。リポジトリの作成も同時に
reposes = Dir.glob("git_repos/*")
reposes.each do |repos_path|
puts repos_path
repos = File.basename(repos_path, ".*")
system("curl --user nicklegr:PASSWORD https://api.bitbucket.org/1.0/repositories/ --data is_private='true' --data name=#{repos}")
Dir.chdir(repos_path) do
system("git remote add origin https://[email protected]/nicklegr/#{repos}.git")
system("git push -u origin master")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment