emm*_*mby 5 google-code github
我正在尝试将项目从Google Code移到Github,我找不到迁移问题单的方法.
我发现https://github.com/arthur-debert/google-code-issues-migrator似乎是谷歌搜索中"从谷歌代码迁移到github的问题"中的热门话题,但是我所得到的所有内容试图使用它是一个404.
我似乎可以将Google Code票证导出为CSV,但是a)我没有看到将CSV导入github的方法,并且b)它似乎只是关于每张票证的最近数据.
有没有其他方法可以将我的问题从Google Code迁移到Github?
我将我的谷歌代码问题导出到 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
Run Code Online (Sandbox Code Playgroud)
替换xxx为适合您用途的值,并确保首先在测试存储库上运行它。
然后我用指向 github 问题列表的评论关闭了 google 代码中的所有问题。使用 Google 代码中“管理”菜单的“高级”选项卡,我用一个 wiki 页面替换了“问题”选项卡,该页面还向人们指出了 github 问题列表。