{"id":3030,"date":"2019-04-02T09:14:30","date_gmt":"2019-04-02T09:14:30","guid":{"rendered":"https:\/\/www.chihayafuru.jp\/tech\/?p=3030"},"modified":"2025-09-20T07:29:24","modified_gmt":"2025-09-19T22:29:24","slug":"git-%e8%a4%87%e6%95%b0%e3%81%ae%e3%83%aa%e3%83%a2%e3%83%bc%e3%83%88%e3%83%aa%e3%83%9d%e3%82%b8%e3%83%88%e3%83%aa%e5%af%be%e5%bf%9c","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/3030","title":{"rendered":"[git] \u8907\u6570\u306e\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u5bfe\u5fdc"},"content":{"rendered":"<h3>1. \u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u8ffd\u52a0<\/h3>\n<h4>1.1. \u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u8a2d\u5b9a<\/h4>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git remote add <\u30ea\u30e2\u30fc\u30c8\u540d> <URL><\/pre>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git remote add azure https:\/\/jane@dev.azure.com\/our_organization\/our_project\/_git\/our_repo<\/pre>\n<h4>1.2. \u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089\u306e\u30d5\u30a7\u30c3\u30c1<\/h4>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git fetch <\u30ea\u30e2\u30fc\u30c8\u540d><\/pre>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git fetch azure<\/pre>\n<p><!--more--><\/p>\n<p>&nbsp;<\/p>\n<h3>2. \u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u524a\u9664<\/h3>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git remote remove <\u30ea\u30e2\u30fc\u30c8\u540d><\/pre>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git remote remove azure<\/pre>\n<p>&nbsp;<\/p>\n<h3>3. \u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u8a2d\u5b9a\u72b6\u6cc1\u30c1\u30a7\u30c3\u30af<\/h3>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git remote -v\r\nazure   https:\/\/jane@dev.azure.com\/our_organization\/our_project\/_git\/our_repo (fetch)\r\nazure   https:\/\/jane@dev.azure.com\/our_organization\/our_project\/_git\/our_repo (push)\r\norigin  http:\/\/mine.local\/\/git\/my_repo (fetch)\r\norigin  http:\/\/mine.local\/\/git\/my_repo (push)<\/pre>\n<p>&nbsp;<\/p>\n<h3>4. \uff08\u65b0\u898f\u306e\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u306e\uff09checkout\u306e\u65b9\u6cd5<\/h3>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git branch new_branch origin\/new_branch\r\n\r\n$ git checkout new_branch\r\n\r\n$ git pull origin new_branch<\/pre>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git checkout -b new_branch origin\/new_branch<\/pre>\n<p>&nbsp;<\/p>\n<h3>5. pull\u306e\u65b9\u6cd5<\/h3>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git pull origin master<\/pre>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git pull azure master<\/pre>\n<p>&nbsp;<\/p>\n<h3>6. push\u306e\u65b9\u6cd5<\/h3>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push origin <\u30ed\u30fc\u30ab\u30eb\u30d6\u30e9\u30f3\u30c1\u540d>:<\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u540d><\/pre>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push origin master:master<\/pre>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push origin master<\/pre>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push azure master<\/pre>\n<p><code>-u, --set-upstream<\/code> : upstream \u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u6307\u5b9a\u3057\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u8907\u6570\u306eremote\u30ea\u30dd\u30b8\u30c8\u30ea(upstream)\u3092\u5207\u308a\u66ff\u3048\u308b\u30b1\u30fc\u30b9\u3067\u306f\u4e0d\u9069\u5207\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>7. References<\/h3>\n<ul>\n<li><a href=\"\/tech\/index.php\/archives\/1132\">[git] \u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u306e\u64cd\u4f5c\u65b9\u6cd5<\/a><\/li>\n<li><a href=\"\/tech\/index.php\/archives\/1436\">[git] \u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u306e\u64cd\u4f5c<\/a><\/li>\n<li><a href=\"\/tech\/index.php\/archives\/8121\">[git] \u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\u3059\u308b<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>1. \u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u8ffd\u52a0 1.1. \u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u8a2d\u5b9a $ git remote add $ git remote add azure https:\/\/jane@dev.azure.com\/our_organ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[2],"class_list":["post-3030","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\/3030","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=3030"}],"version-history":[{"count":16,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/3030\/revisions"}],"predecessor-version":[{"id":8129,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/3030\/revisions\/8129"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=3030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=3030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=3030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}