Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save daipresents/05c7c4667d7e80a280a229b2b33b872c to your computer and use it in GitHub Desktop.
Save daipresents/05c7c4667d7e80a280a229b2b33b872c to your computer and use it in GitHub Desktop.
4コマでわかるSVNからgitへの移行
$ bash
$ export SVN_URL=http://daipresents.googlecode.com/svn
$ export TAG_NAME=redmine_all_time_team-0.2.0
$ git tag ${TAG_NAME} refs/remotes/tags/${TAG_NAME}
$ git push --tags
$ git tag
redmine_all_time_team-0.2.0
$ cd ../googlecode
$ git branch
* master
python-test-branch
$ git branch -r
$ git tag
redmine_all_time_team-0.2.0
$ git config remote.origin.url https://github.com/daipresents/googlecode.git
$ git push origin master
$ git push --all
$ git push --tags
$ mkdir svn2git
$ cd svn2git
$ git svn init -s ${SVN_URL}
$ git svn fetch
$ cd ../
$ mkdir googlecode
$ cd googlecode
$ git --bare init
$ cd ../
$ cd svn2git
$ git remote add origin ../googlecode
$ git branch local-trunk refs/remotes/trunk
$ git push origin local-trunk:master
$ git branch
local-trunk
* master
$ git branch -r
origin/master
python-test-branch
python-test-branch@97
tags/redmine_all_time_team-0.2.0
tags/redmine_all_time_team-0.2.0@71
tags/redmine_daizu-0.4.0
tags/redmine_daizu-0.4.0@53
tags/redmine_roadmaps-0.4.3
tags/redmine_roadmaps-0.4.3@79
trunk
$ export BRANCH_NAME=python-test-branch
$ git branch local-${BRANCH_NAME} refs/remotes/${BRANCH_NAME}
$ git push origin local-${BRANCH_NAME}:${BRANCH_NAME}
$ git branch -r
origin/master
origin/python-test-branch
python-test-branch
python-test-branch@97
tags/redmine_all_time_team-0.2.0
tags/redmine_all_time_team-0.2.0@71
tags/redmine_daizu-0.4.0
tags/redmine_daizu-0.4.0@53
tags/redmine_roadmaps-0.4.3
tags/redmine_roadmaps-0.4.3@79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment