Skip to content

Instantly share code, notes, and snippets.

@t-nissie
Last active January 1, 2018 23:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save t-nissie/df287664c19d773be8979ada49326532 to your computer and use it in GitHub Desktop.
Save t-nissie/df287664c19d773be8979ada49326532 to your computer and use it in GitHub Desktop.
Git と A successful Git branching model の練習のためSourceForgueのSubversionレポジトリにあるxtalgrowthをGitHubへ移動させた

SourceForgueのSubversionレポジトリからGitHubへの引越

Git と A successful Git branching model の練習のためSourceForgueのSubversionレポジトリにあるxtalgrowthを GitHubへ移動させる。ssh-keyは双方について適宜設定されているものとする。

もっと冴えたやりかた等、ご意見募集中。

参考文献

Subversionレポジトリの様子

trunkは5.8MB程度。画像が何枚かあるので大きめ。 lotoプロジェクトのサブプロジェクトになっていた。 tagとbranchは作らなかった。

$ pwd
/Users/takeshi/f/loto/xtalgrowth/trunk
$ svn info .
Path: .
Working Copy Root Path: /Users/takeshi/f/loto
URL: https://svn.code.sf.net/p/loto/code/xtalgrowth/trunk
Repository Root: https://svn.code.sf.net/p/loto/code
Repository UUID: 66b5f4e2-d06a-45f9-b3fd-3971e49ba91e
Revision: 2998
Node Kind: directory
Schedule: normal
Last Changed Author: t-nissie
Last Changed Rev: 2998
Last Changed Date: 2017-10-15 09:03:47 +0900 (Sun, 15 Oct 2017)

$ du -sh .
5.8M	.

とりあえずgit svn clone

/Users/takeshi/authors.txtを用意。 このファイルの場所は .git/config に書かれるのでいつでも変更可能。

t-nissie = t-nissie <t-nissie@example.com>

とりあえずgit svn clone。 ディレクトリ xtalgrowth/ が作られるはず。

$ git svn clone --stdlayout --authors-file=/Users/takeshi/authors.txt --prefix=svn/ https://svn.code.sf.net/p/loto/code/xtalgrowth
Initialized empty Git repository in /Users/takeshi/c/xtalgrowth/.git/
Using higher level of URL: https://svn.code.sf.net/p/loto/code/xtalgrowth => https://svn.code.sf.net/p/loto/code
W: Ignoring error from SVN, path probably does not exist: (160013): Filesystem has no item: File not found: revision 100, path '/xtalgrowth'
W: Do not be alarmed at the above message git-svn is just searching aggressively for old history.
This may take a while on large repositories
Checked Ahrough README-ja
	A	src/rand_ary.c
	A	src/xtalgrowth.c
	A	src/rand_ary.h
	:
$ cd xtalgrowth
$ ls -la
$ git branch -a
* master
  remotes/svn/trunk

そのリポジトリをgithubにpush

GitHubにWebから中身のないリポジトリを作くる。 そこにgit pushする。 2行目の--set-upstreamにより、次回から git pushgit push origin master と等価になる。

$ git remote add origin git@github.com:t-nissie/xtalgrowth.git
$ git push --set-upstream origin master
$ git branch -a
$ git branch -a
* master
  remotes/origin/master
  remotes/svn/trunk
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working directory clean

引越し先はここ → https://github.com/t-nissie/xtalgrowth

他所でgit clone

もちろん他所でgit cloneできる。

$ git clone git@github.com:t-nissie/xtalgrowth.git
$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
/* -*-CSS-*-
* style.css for README.html of feram
* Time-stamp: <2018-01-02 07:52:09 takeshi>
* Author: Takeshi NISHIMATSU
*/
body {
color: black;
font-family: verdana, arial, helvetica, sans-serif;
}
h1, h2, h3, h4, h6 {
font-family: verdana, arial, helvetica, sans-serif;
}
h1 {
color: #dd0000;
background-color: #fff0f0;
font-size: 240%;
}
h2 {
border-top: red 5px solid;
border-bottom: red 1px solid;
padding-left: 8px;
background-color: #fff0f0;
}
h3 {
border-top: red 2px solid;
border-bottom: red 1px solid;
padding-left: 4px;
}
h4 {
border-top: red 1px solid;
padding-left: 4px;
background-color: #fff0f0;
}
h5 {
font-size: larger;
font-family: courier, verdana, arial, helvetica, sans-serif;
padding-top: 10px;
color: darkred;
}
code {
font-size: larger;
font-family: monospace, courier, verdana, arial, helvetica, sans-serif;
color: darkred;
background-color: #f3f3f3;
}
pre {
font-family: monospace, courier, verdana, arial, helvetica, sans-serif;
padding-right: 0.5em;
padding-left: 0.5em;
padding-top: 0.1ex;
padding-bottom: 0.1ex;
margin-left: 0.5em;
margin-right: 1.0em;
white-space: pre;
color: darkred;
background-color: #f3f3f3;
}
p img {
width: 60%;
margin: auto;
display: block;
}
div.figure div.figcaption {
width: 60%;
margin: auto;
display: block;
}
div.navi {
text-align: right;
margin-right: 1.0em;
}
div.contents {
margin-left: 10%;
}
img{
width: 30%;
margin: auto;
margin-top: 3.0em;
display: block;
}
figure figcaption{
width: 60%;
margin: auto;
margin-bottom: 3.0em;
display: block;
}
table{
border-top: 1px solid;
border-left: 1px solid;
border-collapse: collapse;
border-spacing: 0;
empty-cells: show;
text-align: center;
margin: auto;
}
th{
border-right: 1px solid;
border-bottom: 1px solid;
background-color: #fff0f0;
padding: 0.3em 1em;
}
td{
border-right: 1px solid;
border-bottom: 1px solid;
padding: 0.3em 1em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment