{"id":1132,"date":"2016-10-31T18:56:46","date_gmt":"2016-10-31T09:56:46","guid":{"rendered":"http:\/\/www.chihayafuru.jp\/tech\/?p=1132"},"modified":"2025-09-20T07:28:51","modified_gmt":"2025-09-19T22:28:51","slug":"git%e3%81%ae%e3%83%aa%e3%83%a2%e3%83%bc%e3%83%88%e3%83%96%e3%83%a9%e3%83%b3%e3%83%81%e3%81%ae%e6%93%8d%e4%bd%9c%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/1132","title":{"rendered":"[git] \u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u306e\u64cd\u4f5c\u65b9\u6cd5"},"content":{"rendered":"<h3>1. \u30ea\u30e2\u30fc\u30c8\u30b5\u30fc\u30d0\u30fc\u306b\u3042\u308b\u30d6\u30e9\u30f3\u30c1\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5<\/h3>\n<h4>1.1. \u30d6\u30e9\u30f3\u30c1\u306e\u78ba\u8a8d<\/h4>\n<h4>1.1.1. \u5168\u3066\uff08\u30ed\u30fc\u30ab\u30eb\u3068\u30ea\u30e2\u30fc\u30c8\uff09\u306e\u30d6\u30e9\u30f3\u30c1\u306e\u4e00\u89a7<\/p>\n<pre class=\"lang:default decode:true \" >$ git branch -a\r\n* master\r\n  xyz\r\n  remotes\/origin\/HEAD -> origin\/master\r\n  remotes\/origin\/master\r\n  remotes\/origin\/xyz<\/pre>\n<h4>1.1.2. \u30ea\u30e2\u30fc\u30c8\u306e\u30d6\u30e9\u30f3\u30c1\u306e\u4e00\u89a7<\/p>\n<pre class=\"lang:default decode:true \" >$ git branch -r\r\n  remotes\/origin\/HEAD -> origin\/master\r\n  remotes\/origin\/master\r\n  remotes\/origin\/xyz<\/pre>\n<p><!--more--><\/p>\n<h4>1.2. \u30ed\u30fc\u30ab\u30eb\u306b\u3042\u308b\u30d6\u30e9\u30f3\u30c1\u3092\u524a\u9664\u3059\u308b<\/h4>\n<pre class=\"lang:default decode:true \" >$ git branch -d &lt;\u30ed\u30fc\u30ab\u30eb\u30d6\u30e9\u30f3\u30c1\u540d&gt;<\/pre>\n<pre class=\"lang:default decode:true \" >$ git branch -d xyz<\/pre>\n<p>&nbsp;<\/p>\n<h4>1.3. \u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u3092\u524a\u9664\u3059\u308b<\/h4>\n<pre class=\"lang:default decode:true \" >$ git push origin :&lt;\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u540d&gt;<\/pre>\n<pre class=\"lang:default decode:true \" >$ git push origin :xyz<\/pre>\n<pre class=\"lang:default decode:true \" >$ git push --delete origin &lt;\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u540d&gt;<\/pre>\n<pre class=\"lang:default decode:true \" >$ git push --delete origin xyz<\/pre>\n<p>&nbsp;<\/p>\n<h4>1.3.1. push\u30b3\u30de\u30f3\u30c9\u306e\u8a73\u7d30<\/h4>\n<pre class=\"lang:default decode:true \" >$ git push origin &lt;\u30ed\u30fc\u30ab\u30eb\u30d6\u30e9\u30f3\u30c1\u540d&gt;:&lt;\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u540d&gt;<\/pre>\n<p>\u30ed\u30fc\u30ab\u30eb\u30d6\u30e9\u30f3\u30c1\u540d\u304c\u7701\u7565\u3055\u308c\u308b\u3068\u7121\u540d\u306e\u30d6\u30e9\u30f3\u30c1\u540d\u3067\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u3092\u4e0a\u66f8\u304d\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4>1.4. \u30d6\u30e9\u30f3\u30c1\u306e\u78ba\u8a8d<\/h4>\n<pre class=\"lang:default decode:true \" >$ git branch -a\r\n* master\r\n  remotes\/origin\/HEAD -> origin\/master\r\n  remotes\/origin\/master<\/pre>\n<p>&nbsp;<\/p>\n<h3>2. \u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u3092\u30ed\u30fc\u30ab\u30eb\u306b\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\u3059\u308b\u65b9\u6cd5<\/h3>\n<p>\u203b &quot;git fetch&quot; \u306b\u3066\u3001\u30ea\u30e2\u30fc\u30c8\u8ffd\u8de1\u30d6\u30e9\u30f3\u30c1\u306efetch\u304c\u6210\u529f\u3057\u3066\u3044\u308b\u524d\u63d0\u3067\u306e\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u64cd\u4f5c<\/p>\n<pre class=\"lang:default decode:true \" >$ git checkout -b &lt;\u30ed\u30fc\u30ab\u30eb\u30d6\u30e9\u30f3\u30c1\u540d&gt; &lt;\u30ea\u30dd\u30b8\u30c8\u30ea\u540d&gt;\/&lt;\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u540d&gt;<\/pre>\n<pre class=\"lang:default decode:true \" >$ git checkout -b xyz origin\/xyz<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \" >$ git switch -c &lt;\u30ed\u30fc\u30ab\u30eb\u30d6\u30e9\u30f3\u30c1\u540d&gt; origin\/&lt;\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u540d&gt;<\/pre>\n<pre class=\"lang:default decode:true \" >$ git switch -c xyz origin\/xyz<\/pre>\n<p>&nbsp;<\/p>\n<h3>3. \u3010\u304a\u307e\u3051\u3011\u30ea\u30e2\u30fc\u30c8\u8ffd\u8de1\u30d6\u30e9\u30f3\u30c1(remote tracking branch)\u3092\u524a\u9664\u3059\u308b<\/h3>\n<pre class=\"lang:default decode:true \" >$ git branch -d -r &lt;\u30d6\u30e9\u30f3\u30c1\u540d&gt;<\/pre>\n<pre class=\"lang:default decode:true \" >$ git branch -d -r xyz<\/pre>\n<p>&nbsp;<\/p>\n<h3>4. References<\/h3>\n<ul>\n<li><a href=\"\/tech\/index.php\/archives\/1436\">[git] \u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u64cd\u4f5c<\/a><\/li>\n<li><a href=\"\/tech\/index.php\/archives\/3030\">[git] \u8907\u6570\u306e\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u5bfe\u5fdc<\/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\u30b5\u30fc\u30d0\u30fc\u306b\u3042\u308b\u30d6\u30e9\u30f3\u30c1\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5 1.1. \u30d6\u30e9\u30f3\u30c1\u306e\u78ba\u8a8d 1.1.1. \u5168\u3066\uff08\u30ed\u30fc\u30ab\u30eb\u3068\u30ea\u30e2\u30fc\u30c8\uff09\u306e\u30d6\u30e9\u30f3\u30c1\u306e\u4e00\u89a7 $ git branch -a * master xyz remotes\/origi [&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-1132","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\/1132","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=1132"}],"version-history":[{"count":22,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/1132\/revisions"}],"predecessor-version":[{"id":8128,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/1132\/revisions\/8128"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=1132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=1132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=1132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}