2013-07-24 29 views
5

我正在嘗試將項目從Google代碼移動到Github,但我找不到遷移問題單的方法。如何將Google代碼項目中的問題導出到Github?

我發現https://github.com/arthur-debert/google-code-issues-migrator這似乎是谷歌搜索中的「將代碼從谷歌代碼遷移到github」中的熱門搜索,但是當我嘗試使用它時,我得到的所有內容都是is a 404

看來我可以將CSV代碼票導出爲CSV格式,但是a)我沒有看到將CSV導入github的方法,以及b)它似乎只是關於每張票的最差數據。

是否有另一種方法將我的問題從Google Code遷移到Github?

回答

3

我出口我的谷歌代碼問題爲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問題列表。

0

根據原始帖子中提到的issue,此後有一個pull request據說修復了404錯誤。