Created
December 14, 2014 09:38
-
-
Save nicklegr/15f812600bf98f1becaa to your computer and use it in GitHub Desktop.
gitリポジトリをbitbucketに一括push。リポジトリの作成も同時に
This file contains hidden or 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
| 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