LoginSignup
7
6

More than 5 years have passed since last update.

svnリポジトリをgithubにup

Posted at

準備

authors.txt を用意

(svn ユーザ名)=(GitHubユーザ名) <GitHubメールアドレス>

ユーザ名がなくてもメアドさえあれば紐づけてくれるようでした

$ cat authors.txt
user0001=mist-dev <mist-dev@example.com>
user0002=hoge <hoge@example.com>
user0003= <fuga@example.com>

今回は以下のディレクトリで作業します

~
└ workspace
    ├ authors.txt
    └ $REPO_NAME

うp

svnリポジトリをgit-svnでコンバートしてpushしたらエラーに

$ cd ~/workspace
$ git svn clone --authors-file=authors.txt -s svn://xxx.xxx.xxx.xxx/$REPO_NAME $REPO_NAME
$ cd $REPO_NAME
$ git remote add origin https://github.com/$REPO_NAME.git
$ git push origin master

Counting objects: 7406, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2594/2594), done.
error: RPC failed; result=22, HTTP code = 0
fatal: The remote end hung up unexpectedly
Writing objects: 100% (7406/7406), 1.94 MiB, done.
Total 7406 (delta 2709), reused 7132 (delta 2483)
fatal: The remote end hung up unexpectedly
fatal: expected ok/error, helper said '2004?݊Ňm????/z?Le?Q? ?L?
                                                                   ???h?$?1;/T'

http://kkurahar.github.io/blog/2013/09/21/stash-new-repo/ をみたところGitのバージョンが怪しそう

$ git --version
git version 1.7.4.4

HomeBrewでgitをインストールし、そちらをみるよう設定する

$ brew install git
$ vi ~/.bash_profile
# こんなかんじでPATHに/usr/local/binを優先

export PATH=/usr/local/bin:$PATH

.bash_profileを読み込み直し、git のバージョンを確認

$ source ~/.bash_profile
$ git --version
git version 1.9.3

git-svnからやりなおし再度push

$ cd ~/workspace
$ git svn clone --authors-file=authors.txt -s svn://xxx.xxx.xxx.xxx/$REPO_NAME $REPO_NAME
$ cd $REPO_NAME
$ git remote add origin https://github.com/$REPO_NAME.git
$ git push origin master

Counting objects: 7406, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2592/2592), done.
Writing objects: 100% (7406/7406), 1.94 MiB | 626.00 KiB/s, done.
Total 7406 (delta 2712), reused 7132 (delta 2485)
To https://github.com/$REPO_NAME.git
 * [new branch]      master -> master

無事GitHubにソースをあげることができました

7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6