我出口我的谷歌代碼問題爲CSV(這可悲的是不包括註釋),然後用下面的腳本將它們導入到github上:
#!/usr/bin/env ruby
# Based on https://gist.github.com/visnup/1117145
require 'rubygems'
require 'FasterCSV'
require 'httparty'
require 'json'
github_user = 'xxx'
github_repo = 'xxx'
gcode_repo = 'xxx'
class GitHub
include HTTParty
base_uri 'https://api.github.com'
basic_auth "xxx", "xxx"
end
FasterCSV.open ARGV.shift, :headers => true do |csv|
csv.each do |r|
# title, body, assignee, milestone, labels
body = {
:title => r['Summary'],
:body => "Issue Migrated from http://code.google.com/p/#{gcode_repo}/issues/detail?id=#{r['ID']}",
:labels => [ "gcode"]
}
issue = GitHub.post "/repos/#{github_user}/#{github_repo}/issues", :body => JSON.generate(body)
p issue
end
end
更換xxx
用適當的值,請使用,並確保您首先在測試回購庫上運行它。
然後,我關閉了所有問題在谷歌代碼與評論指向github問題列表。使用Google代碼中管理菜單的高級選項卡,我將問題選項卡替換爲一個wiki頁面,該頁面也將人員指向github問題列表。