{"id":4653,"date":"2019-08-16T20:58:33","date_gmt":"2019-08-16T11:58:33","guid":{"rendered":"https:\/\/greentown.tokyo\/?p=4653"},"modified":"2019-08-16T21:01:53","modified_gmt":"2019-08-16T12:01:53","slug":"git-upstream","status":"publish","type":"post","link":"https:\/\/greentown.tokyo\/?p=4653","title":{"rendered":"git\u30e1\u30e2 - fork\u3092master\u306b\u8ffd\u5f93\u3055\u305b\u305f\u3042\u3068\u3001\u4e00\u90e8\u306e\u5909\u66f4\u3060\u3051\u53d6\u308a\u8fbc\u3080"},"content":{"rendered":"<p>\u304a\u3055\u3089\u3044\u3057\u3064\u3064\u3001\u56f0\u3063\u305f\uff06\u89e3\u6c7a\u3057\u305f\u306e\u3067\u30e1\u30e2<\/p>\n<p><a href=\"https:\/\/greentown.tokyo\/wp-content\/uploads\/2019\/08\/sunset-4405820_1280.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4659\" src=\"https:\/\/greentown.tokyo\/wp-content\/uploads\/2019\/08\/sunset-4405820_1280.jpg\" alt=\"\" width=\"1280\" height=\"853\" srcset=\"https:\/\/greentown.tokyo\/wp-content\/uploads\/2019\/08\/sunset-4405820_1280.jpg 1280w, https:\/\/greentown.tokyo\/wp-content\/uploads\/2019\/08\/sunset-4405820_1280-300x200.jpg 300w, https:\/\/greentown.tokyo\/wp-content\/uploads\/2019\/08\/sunset-4405820_1280-768x512.jpg 768w, https:\/\/greentown.tokyo\/wp-content\/uploads\/2019\/08\/sunset-4405820_1280-1024x682.jpg 1024w\" sizes=\"(max-width: 1280px) 100vw, 1280px\" \/><\/a><\/p>\n<h3>\u672c\u5bb6\u306b\u8ffd\u5f93\u3055\u305b\u308b<\/h3>\n<h6>1. \u78ba\u8a8d\u3059\u308b<\/h6>\n<pre class=\"theme:dark-terminal lang:sh decode:true\">$ git branch\u3000-a\r\n* master\r\n  remotes\/origin\/HEAD -&gt; origin\/master\r\n  remotes\/origin\/master<\/pre>\n<h6>2. \u672c\u5bb6\u3092\u767b\u9332\u3059\u308b<\/h6>\n<p>$ git remote add {\u4efb\u610f\u306e\u540d\u524d} {\u672c\u5bb6\u306eURL}<\/p>\n<p>$ git remote add upstream https:\/\/github.com\/xxxx\/xxxxx.git<\/p>\n<p>\u3068\u304b<\/p>\n<p>$ git remote add fork_master\u00a0https:\/\/github.com\/xxxx\/xxxxx.git<\/p>\n<p>\u3068\u304b\u3068\u304b<\/p>\n<pre class=\"theme:dark-terminal lang:sh decode:true\">$ git branch -a\r\n* master\r\n  remotes\/origin\/HEAD -&gt; origin\/master\r\n  remotes\/origin\/master\r\n  remotes\/upstream\/master<\/pre>\n<p>remotes\/upstream\/master\u304c\u767b\u9332\u3055\u308c\u305f\u3002<\/p>\n<h3>\u672c\u5bb6\u304b\u3089\u6700\u65b0\u306e\u30b3\u30fc\u30c9\u3092\u30ed\u30fc\u30ab\u30eb\u30ea\u30dd\u30b8\u30c8\u30ea\u3078\u30de\u30fc\u30b8\u3059\u308b<\/h3>\n<h6>1. \u672c\u5bb6\u304b\u3089\u6700\u65b0\u306e\u30b3\u30fc\u30c9\u3092\u53d6\u5f97\u3059\u308b<\/h6>\n<p>$ git fetch upstream<\/p>\n<h6>2. \u672c\u5bb6\u306e\u6700\u65b0\u30b3\u30fc\u30c9\u3092\u30ed\u30fc\u30ab\u30eb\u30ea\u30dd\u30b8\u30c8\u30ea\u3078\u30de\u30fc\u30b8\u3059\u308b<\/h6>\n<p>$ git merge upstream\/master<\/p>\n<p>\u4eca\u56de\u3053\u3053\u3067\u30a8\u30e9\u30fc<\/p>\n<pre class=\"theme:dark-terminal lang:sh decode:true \">$ git fetch upstream\r\n$ git merge upstream\/master\r\nUpdating 0dd90ca..bc98fdf\r\nerror: Your local changes to the following files would be overwritten by merge:\r\n\tsrc\/config.js\r\nPlease commit your changes or stash them before you merge.\r\nAborting\r\n<\/pre>\n<p>src\/config.js \u306f\u30de\u30a4\u8a2d\u5b9a\u306a\u306e\u3067\u3001\u672c\u5bb6\u306e\u5909\u66f4\u5206\u3060\u3051\u53d6\u308a\u8fbc\u307f\u305f\u3044\u30fb\u30fb<\/p>\n<div class=\"freebox has-title \" style=\"background:#FFFDE7;border-color:#FFC107;border-radius:0 5px 5px;\"><p class=\"p-free\" style=\"background:#FFC107;border-color:#FFC107;font-weight:bold;\"><span class=\"p-entry-f\" style=\"background:#FFC107;font-weight:bold;border-radius: 0 0 5px 0;\"><i class=\"st-fa  fa-check-circle faa-ring animated st-css-no\" aria-hidden=\"true\"><\/i>\u672c\u5bb6\u304b\u3089\u306e\u30a2\u30c9\u30d0\u30a4\u30b9<\/span><\/p><div class=\"free-inbox\">\n<ul>\n<li>src\/config.js\u306blocal\u306e\u5909\u66f4\u304c\u5165\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u308c\u3092commit\u3059\u308b\u304b\u3001\u623b\u3055\u306a\u3044\u3068 merge\u3067\u304d\u307e\u305b\u3093<\/li>\n<li>commit\u3059\u308b\u3068\u3001PR\u4f5c\u308b\u3068\u304d\u306b\u3001\u305d\u306ecommit\u3082\u5165\u3063\u3066\u3057\u307e\u3046\u306e\u3067src\/config.js\u3092src\/config.org.js \u306e\u3088\u3046\u306brename\u3057\u3066\u4e00\u65e6\u3001\u9000\u907f\u3057\u3066\n<pre class=\"c-mrkdwn__pre\" data-stringify-type=\"pre\">git merge upstream\/master<\/pre>\n<\/li>\n<li>\u3092\u5b9f\u884c<\/li>\n<li>\u305d\u306e\u5f8c\u3001src\/config.org.js \u3092\u30b3\u30d4\u30fc\u3057\u3066\u623b\u305b\u3070\u3046\u307e\u304f\u3044\u304f\u3068\u601d\u3044\u307e\u3059<\/li>\n<\/ul>\n<\/div><\/div>\n<p>\u3075\u304a\u3049\u301c<\/p>\n<p>\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3057\u305f&#x2728;<\/p>\n<h3>\u30ed\u30fc\u30ab\u30eb\u306e\u7de8\u96c6\u3092\u30d7\u30eb\u30ea\u30af\u3059\u308b\u307e\u3067<\/h3>\n<ol>\n<li>\u30ed\u30fc\u30ab\u30eb\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3059\u308b<\/li>\n<li>\u3053\u3053\u304b\u3089\u306a\u3093\u304b GitKraken\u3067\u3084\u3063\u3066\u307e\u3059\u304c\u3001\u672c\u5bb6\u306b\u53cd\u6620\u3057\u3066\u307b\u3057\u3044\u30d5\u30a1\u30a4\u30eb\u3060\u3051 add \u3059\u308b<\/li>\n<li>commit\u3059\u308b<\/li>\n<li>\u81ea\u5206\u306e\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306b push \u3059\u308b<\/li>\n<li>PR\u4f5c\u308b<\/li>\n<\/ol>\n<p>\u3067\u3001\u672c\u5bb6\u304b\u3089\u6700\u65b0\u3092\u843d\u3068\u3057\u3066\u304f\u308b&#8230;\u306e\u7e70\u308a\u8fd4\u3057\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u304a\u3055\u3089\u3044\u3057\u3064\u3064\u3001\u56f0\u3063\u305f\uff06\u89e3\u6c7a\u3057\u305f\u306e\u3067\u30e1\u30e2 \u672c\u5bb6\u306b\u8ffd\u5f93\u3055\u305b\u308b 1. \u78ba\u8a8d\u3059\u308b $ git branch\u3000-a * master remotes\/origin\/HEAD -&gt; origin\/mast &#8230; <\/p>\n","protected":false},"author":1,"featured_media":4659,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[79],"tags":[],"class_list":["post-4653","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-note"],"_links":{"self":[{"href":"https:\/\/greentown.tokyo\/index.php?rest_route=\/wp\/v2\/posts\/4653"}],"collection":[{"href":"https:\/\/greentown.tokyo\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/greentown.tokyo\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/greentown.tokyo\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/greentown.tokyo\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4653"}],"version-history":[{"count":14,"href":"https:\/\/greentown.tokyo\/index.php?rest_route=\/wp\/v2\/posts\/4653\/revisions"}],"predecessor-version":[{"id":4668,"href":"https:\/\/greentown.tokyo\/index.php?rest_route=\/wp\/v2\/posts\/4653\/revisions\/4668"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/greentown.tokyo\/index.php?rest_route=\/wp\/v2\/media\/4659"}],"wp:attachment":[{"href":"https:\/\/greentown.tokyo\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/greentown.tokyo\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/greentown.tokyo\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}