39 | | == git-http-backend == |
| 42 | == convert svn repos to git == |
| 43 | * trunk/tags/branches -> -s オプションで拾える |
| 44 | * vendor -> 手動でconfig --addしてfetch |
| 45 | * リモートブランチをローカルブランチへ変更する |
| 46 | |
| 47 | 1. mitty@test:~/works$ git svn init -s http://lab.mitty.jp/svn/lab/ lab |
| 48 | {{{ |
| 49 | Initialized empty Git repository in /home/mitty/works/lab/.git/ |
| 50 | }}} |
| 51 | 1. mitty@test:~/works/lab (master)$ cat .git/config |
| 52 | {{{ |
| 53 | [core] |
| 54 | repositoryformatversion = 0 |
| 55 | filemode = true |
| 56 | bare = false |
| 57 | logallrefupdates = true |
| 58 | [svn-remote "svn"] |
| 59 | url = http://lab.mitty.jp/svn/lab |
| 60 | fetch = trunk:refs/remotes/trunk |
| 61 | branches = branches/*:refs/remotes/* |
| 62 | tags = tags/*:refs/remotes/tags/* |
| 63 | }}} |
| 64 | 1. mitty@test:~/works/lab (master)$ git config --add svn-remote.svn.fetch "vendor:refs/remotes/vendor" |
| 65 | {{{ |
| 66 | [core] |
| 67 | repositoryformatversion = 0 |
| 68 | filemode = true |
| 69 | bare = false |
| 70 | logallrefupdates = true |
| 71 | [svn-remote "svn"] |
| 72 | url = http://lab.mitty.jp/svn/lab |
| 73 | fetch = trunk:refs/remotes/trunk |
| 74 | branches = branches/*:refs/remotes/* |
| 75 | tags = tags/*:refs/remotes/tags/* |
| 76 | fetch = vendor:refs/remotes/vendor |
| 77 | }}} |
| 78 | 1. mitty@test:~/works/lab (master)$ git svn fetch |
| 79 | {{{ |
| 80 | |
| 81 | Checked out HEAD: |
| 82 | http://lab.mitty.jp/svn/lab/trunk r204 |
| 83 | creating empty directory: TipAndDoc/tools/trac/plugins |
| 84 | }}} |
| 85 | * mitty@test:~/works/lab (master)$ ls -1F |
| 86 | {{{ |
| 87 | Commentary/ |
| 88 | Dev/ |
| 89 | misc/ |
| 90 | TipAndDoc/ |
| 91 | }}} |
| 92 | * mitty@test:~/works/lab (master)$ git tag -l |
| 93 | * mitty@test:~/works/lab (master)$ git br -a |
| 94 | {{{ |
| 95 | * master |
| 96 | remotes/tags/r89-trunk |
| 97 | remotes/tags/snuploader_name |
| 98 | remotes/tags/snuploader_name@29 |
| 99 | remotes/tags/snuploader_name@36 |
| 100 | remotes/tags/twitter |
| 101 | remotes/trunk |
| 102 | remotes/twitter-0.1 |
| 103 | remotes/twitter-0.1@44 |
| 104 | remotes/twitter-0.1@65 |
| 105 | remotes/twitter-0.1@66 |
| 106 | remotes/vendor |
| 107 | }}} |
| 108 | 1. mitty@test:~/works/lab (master)$ mv .git/refs/remotes/tags/* .git/refs/tags/ |
| 109 | 1. mitty@test:~/works/lab (master)$ rmdir .git/refs/remotes/tags/ |
| 110 | 1. mitty@test:~/works/lab (master)$ mv .git/refs/remotes/* .git/refs/heads/ |
| 111 | 1. mitty@test:~/works/lab (master)$ rmdir .git/refs/remotes/ |
| 112 | * mitty@test:~/works/lab (master)$ git tag -l |
| 113 | {{{ |
| 114 | r89-trunk |
| 115 | snuploader_name |
| 116 | snuploader_name@29 |
| 117 | snuploader_name@36 |
| 118 | twitter |
| 119 | }}} |
| 120 | * mitty@test:~/works/lab (master)$ git br -a |
| 121 | {{{ |
| 122 | * master |
| 123 | trunk |
| 124 | twitter-0.1 |
| 125 | twitter-0.1@44 |
| 126 | twitter-0.1@65 |
| 127 | twitter-0.1@66 |
| 128 | vendor |
| 129 | }}} |
| 130 | * mitty@test:~/works/lab (master)$ git co vendor |
| 131 | {{{ |
| 132 | Switched to branch 'vendor' |
| 133 | }}} |
| 134 | * mitty@test:~/works/lab (vendor)$ ls -1F |
| 135 | {{{ |
| 136 | DrRacket/ |
| 137 | GeSHi-1.0.8.9/ |
| 138 | lxc/ |
| 139 | OCaml/ |
| 140 | SnUploader/ |
| 141 | TipAndDoc/ |
| 142 | trac/ |
| 143 | twitter/ |
| 144 | ubuntu/ |
| 145 | utvpn/ |
| 146 | vmware/ |
| 147 | }}} |
| 148 | |
| 149 | = git-http-backend = |