{"id":285,"date":"2013-09-28T00:33:54","date_gmt":"2013-09-27T15:33:54","guid":{"rendered":"http:\/\/www.chihayafuru.jp\/tech\/?p=285"},"modified":"2017-02-13T14:23:52","modified_gmt":"2017-02-13T05:23:52","slug":"git-svn%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/285","title":{"rendered":"git-svn\u306e\u4f7f\u3044\u65b9"},"content":{"rendered":"<h2>A. \u30ea\u30e2\u30fc\u30c8svn\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089\u306e\u30af\u30ed\u30fc\u30f3<\/h2>\n<h3>1. \u6a19\u6e96\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210\u306e\u5834\u5408 (trunk, branches, tags)<\/h3>\n<pre class=\"lang:sh decode:true \" >$ git svn clone --prefix=svn\/ -s http:\/\/www.sample.com\/my_repository<\/pre>\n<h3>2. \u975e\u6a19\u6e96\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210\u306e\u5834\u5408<\/h3>\n<pre class=\"lang:sh decode:true \" >$ git svn clone --prefix=svn\/ --no-minimize-url http:\/\/www.sample.com\/my_repository<\/pre>\n<p>&nbsp;<\/p>\n<h4><code>--prefix<\/code> \u3092\u3064\u3051\u305f\u3068\u304d<\/h4>\n<pre class=\"lang:sh decode:true \" >$ git branch -r\r\n  svn\/trunk<\/pre>\n<pre class=\"lang:sh decode:true \" >$ git branch -a\r\n* master\r\n  remotes\/svn\/trunk<\/pre>\n<h4><code>--prefix<\/code> \u3092\u3064\u3051\u306a\u3044\u3068\u304d<\/h4>\n<pre class=\"lang:sh decode:true \" >$ git branch -r\r\n  trunk<\/pre>\n<pre class=\"lang:sh decode:true \" >$ git branch -a\r\n* master\r\n  remotes\/trunk<\/pre>\n<p>&nbsp;<\/p>\n<h2>B. \u66f4\u65b0\u51e6\u7406\u306e\u30d5\u30ed\u30fc<\/h2>\n<h3>1. \u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u3068\u306e\u30ea\u30d9\u30fc\u30b9<\/h3>\n<pre class=\"lang:sh decode:true \" >$ git svn rebase<\/pre>\n<h3>2. \u30ef\u30fc\u30ad\u30f3\u30b0\u30d6\u30e9\u30f3\u30c1\u306e\u4f5c\u6210\u3068\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8<\/h3>\n<pre class=\"lang:sh decode:true \" >$ git checkout -b my_working_branch<\/pre>\n<pre class=\"lang:sh decode:true \" >$ git checkout -b my_working_branch svn\/my_working_branch<\/pre>\n<p>\u203b git svn clone\u306b\u304a\u3044\u3066prefix(svn\/)\u3092\u30bb\u30c3\u30c8\u3057\u305f\u52b9\u7528<\/p>\n<h3>3. \u30ef\u30fc\u30ad\u30f3\u30b0\u30d6\u30e9\u30f3\u30c1\u3067\u306e\u66f4\u65b0\u4f5c\u696d<\/h3>\n<pre class=\"lang:sh decode:true \" >$ vi hello.c\r\n$ git add hello.c\r\n...<\/pre>\n<h3>4. \u30ef\u30fc\u30ad\u30f3\u30b0\u30d6\u30e9\u30f3\u30c1\u306e\u30b3\u30df\u30c3\u30c8<\/h3>\n<pre class=\"lang:sh decode:true \" >$ git commit -m \"fix hello.c\"<\/pre>\n<h3>5. \u30ed\u30fc\u30ab\u30eb\u30de\u30b9\u30bf\u30fc\u30d6\u30e9\u30f3\u30c1\u3078\u306e\u5207\u308a\u66ff\u3048<\/h3>\n<pre class=\"lang:sh decode:true \" >$ git checkout master<\/pre>\n<h3>6. \u30ed\u30fc\u30ab\u30eb\u30de\u30b9\u30bf\u30fc\u30d6\u30e9\u30f3\u30c1\u3078\u306e\u30de\u30fc\u30b8<\/h3>\n<pre class=\"lang:sh decode:true \" >$ git merge --no-ff --no-commit my_working_branch<\/pre>\n<dl>\n<dt>&#8211;no-ff<\/dt>\n<\/dd>\n<p>fast-forward\u3092\u7981\u6b62\u3057\u3066\u5fc5\u305a\u30de\u30fc\u30b8\u30b3\u30df\u30c3\u30c8\u3092\u4f5c\u6210\u3059\u308b\u3002\u30ed\u30fc\u30ab\u30eb\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u306f\u5909\u66f4\u5c65\u6b74\u304c\u30d6\u30e9\u30f3\u30c1\u3068\u3057\u3066\u6b8b\u308a\u3001\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u5bfe\u3057\u3066\u306f\u30de\u30fc\u30b8\u30b3\u30df\u30c3\u30c8\u306e\u307f\u304c\u53cd\u6620\u3055\u308c\u308b\u3002<\/dd>\n<\/dl>\n<dl>\n<dt>&#8211;no-commit<\/dt>\n<dd>\u30b3\u30df\u30c3\u30c8\u3092\u4fdd\u7559\u3059\u308b\u3002\uff08\u30de\u30fc\u30b8\uff09\u30b3\u30df\u30c3\u30c8\u304c\uff12\u56de\u767a\u751f\u3059\u308b\u3053\u3068\u3092\u907f\u3051\u308b\u3002<\/dd>\n<\/dl>\n<h3>7. \u30ed\u30fc\u30ab\u30eb\u30de\u30b9\u30bf\u30fc\u30d6\u30e9\u30f3\u30c1\u306e\u30b3\u30df\u30c3\u30c8<\/h3>\n<pre class=\"lang:sh decode:true \" >$ git commit -m \"bug-fix: xxx\"<\/pre>\n<h3>8. \u30ea\u30e2\u30fc\u30c8svn\u30ea\u30dd\u30b8\u30c8\u30ea\u3078\u306e\u30b3\u30df\u30c3\u30c8<\/h3>\n<pre class=\"lang:sh decode:true \" >$ git svn dcommit<\/pre>\n<h3>9. \u30ef\u30fc\u30ad\u30f3\u30b0\u30d6\u30e9\u30f3\u30c1\u306e\u524a\u9664<\/h3>\n<pre class=\"lang:sh decode:true \" >$ git branch -d my_working_branch<\/pre>\n<p><\/p>\n<h2>C. \u305d\u306e\u307b\u304b<\/h2>\n<h3>\u30ed\u30fc\u30ab\u30eb\u30d6\u30e9\u30f3\u30c1\u306e\u78ba\u8a8d<\/h3>\n<pre class=\"lang:sh decode:true \" >$ git branch<\/pre>\n<pre class=\"lang:sh decode:true \" >* master<\/pre>\n<h3>\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u306e\u78ba\u8a8d<\/h3>\n<pre class=\"lang:sh decode:true \" >$ git branch -r<\/pre>\n<pre class=\"lang:sh decode:true \" >  svn\/xxx_1.0.0\r\n  svn\/tags\/1.0.0_release\r\n  svn\/tags\/1.0.1_release\r\n  svn\/trunk<\/pre>\n<h3>\u3059\u3079\u3066\u306e\u30d6\u30e9\u30f3\u30c1\u306e\u78ba\u8a8d<\/h3>\n<pre class=\"lang:sh decode:true \" >$ git branch -a<\/pre>\n<pre class=\"lang:sh decode:true \" >* master\r\n  svn\/xxx_1.0.0\r\n  svn\/tags\/1.0.0_release\r\n  svn\/tags\/1.0.1_release\r\n  svn\/trunk<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A. \u30ea\u30e2\u30fc\u30c8svn\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089\u306e\u30af\u30ed\u30fc\u30f3 1. \u6a19\u6e96\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210\u306e\u5834\u5408 (trunk, branches, tags) $ git svn clone &#8211;prefix=svn\/ -s http:\/\/www.sa [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[2],"class_list":["post-285","post","type-post","status-publish","format-standard","hentry","category-memo","tag-git"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/285","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/comments?post=285"}],"version-history":[{"count":14,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/285\/revisions"}],"predecessor-version":[{"id":697,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/285\/revisions\/697"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=285"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}