{"id":1430,"date":"2017-03-01T16:24:46","date_gmt":"2017-03-01T07:24:46","guid":{"rendered":"http:\/\/www.chihayafuru.jp\/tech\/?p=1430"},"modified":"2024-10-22T14:52:54","modified_gmt":"2024-10-22T05:52:54","slug":"%ef%bc%92%e4%b8%96%e4%bb%a3%e4%bb%a5%e4%b8%8a%e5%89%8d%e3%81%ae%e3%82%b3%e3%83%9f%e3%83%83%e3%83%88%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/1430","title":{"rendered":"[git] \u30b3\u30df\u30c3\u30c8\u306e\u66f8\u304d\u63db\u3048"},"content":{"rendered":"<h2>A. \u76f4\u524d\uff08\uff11\u4e16\u4ee3\u524d\uff09\u306e\u30b3\u30df\u30c3\u30c8\u3092\u66f8\u304d\u63db\u3048\u308b<\/h2>\n<h3>1. \u7de8\u96c6\u3059\u308b\uff08\u4fee\u6b63\u3059\u308b\uff09<\/h3>\n<pre class=\"lang:sh highlight:0 decode:true \" >$ vim &lt;file&gt;<\/pre>\n<h3>2. \u4fee\u6b63\u3092\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u3059\u308b<\/h3>\n<pre class=\"lang:sh highlight:0 decode:true \" >$ git add &lt;file&gt;<\/pre>\n<h3>3. \u30b3\u30df\u30c3\u30c8\u3059\u308b\uff08\u4fee\u6b63\u3057\u305f\u5185\u5bb9\u3067\u30b3\u30df\u30c3\u30c8\u3092\u3084\u308a\u76f4\u3059\uff09<\/h3>\n<pre class=\"lang:sh highlight:0 decode:true \" >$ git commit --amend<\/pre>\n<p><!--more--><\/p>\n<hr>\n<h2>B. \uff12\u4e16\u4ee3\u4ee5\u4e0a\u524d\u306e\u30b3\u30df\u30c3\u30c8\u3092\u66f8\u304d\u63db\u3048\u308b<\/h2>\n<h3>\u30ea\u30d9\u30fc\u30b9\u3059\u308b<\/h3>\n<pre class=\"lang:sh highlight:0 decode:true \" >$ git rebase -i HEAD~3<\/pre>\n<pre class=\"lang:sh highlight:0 decode:true \" >pick eeb019d delete the fold lines\r\npick 83235ee brush up the cutting lines\r\npick 87ded2d update the version : 0.4.0\r\n\r\n# Rebase f55fdf9..87ded2d onto f55fdf9 (3 commands)\r\n#\r\n# Commands:\r\n# p, pick = use commit\r\n# r, reword = use commit, but edit the commit message\r\n# e, edit = use commit, but stop for amending\r\n# s, squash = use commit, but meld into previous commit\r\n# f, fixup = like \"squash\", but discard this commit's log message\r\n# x, exec = run command (the rest of the line) using shell\r\n# d, drop = remove commit\r\n#\r\n# These lines can be re-ordered; they are executed from top to bottom.\r\n#\r\n# If you remove a line here THAT COMMIT WILL BE LOST.\r\n#\r\n# However, if you remove everything, the rebase will be aborted.\r\n#\r\n# Note that empty commits are commented out<\/pre>\n<p>\u4e0a\u304b\u3089\u4e0b\u3078 \u53e4\u3044\u30b3\u30df\u30c3\u30c8 &rArr; \u65b0\u3057\u3044\u30b3\u30df\u30c3\u30c8 \u306e\u9806\u306b\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7\u3055\u308c\u308b\u3002 git log \u306e\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7\u9806\u5e8f\u3068\u9006\u3002<\/p>\n<ul>\n<li><strong>p<\/strong>, pick = \u30b3\u30df\u30c3\u30c8\u3092\u3042\u308a\u306e\u307e\u307e\u4f7f\u3046\u3002<\/li>\n<li><strong>r<\/strong>, reword = \u30b3\u30df\u30c3\u30c8\u3092\u4f7f\u3046\u3002\u305f\u3060\u3057\u3001\u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u3060\u3051\u306f\u7de8\u96c6\u3059\u308b\u3002<\/li>\n<li><strong>e<\/strong>, edit = \u30b3\u30df\u30c3\u30c8\u3092\u7de8\u96c6\u3059\u308b\u3002amend \u3067\u30b3\u30df\u30c3\u30c8\u3092\u3084\u308a\u76f4\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/li>\n<li><strong>s<\/strong>, squash = \u30b3\u30df\u30c3\u30c8\u3092\u4f7f\u3046\u3002\u305f\u3060\u3057\u76f4\u524d\u306e\u30b3\u30df\u30c3\u30c8\u3068\u4e00\u672c\u5316\u3059\u308b\u3002\u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u7de8\u96c6\uff08\u30de\u30fc\u30b8\uff09\u3059\u308b\u624b\u9806\u3042\u308a\u3002<\/li>\n<li><strong>f<\/strong>, fixup = \u30b3\u30df\u30c3\u30c8\u3092\u4f7f\u3046\u3002\u305f\u3060\u3057\u76f4\u524d\u306e\u30b3\u30df\u30c3\u30c8\u3068\u4e00\u672c\u5316\u3059\u308b\u3002\u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u7de8\u96c6\u3059\u308b\u624b\u9806\u306a\u3057\u3002fixup\u304c\u30de\u30fc\u30af\u3055\u308c\u305f\u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u7834\u68c4\u3059\u308b\u3002<\/li>\n<li><strong>d<\/strong>, drop = \u30b3\u30df\u30c3\u30c8\u3092\u6368\u3066\u308b\u3002<\/li>\n<\/ul>\n<h3>X. \u30b3\u30df\u30c3\u30c8\u306b\u307e\u3068\u3081\u308b\u3002\u4e00\u7dd2\u306b\u3059\u308b\u3002<\/h3>\n<p>\u8907\u6570\u306e\u30b3\u30df\u30c3\u30c8\u306e\u6b74\u53f2\u3092\uff11\u3064\u306b\u307e\u3068\u3081\u308b\u3060\u3051\u3067\u3001\u30ea\u30d9\u30fc\u30b9\u5f8c\u306e\u7d50\u679c\u306f\u540c\u4e00\u3067\u3042\u308b\u3002<\/p>\n<p>\u884c\u982d\u306e<b>pick<\/b> \u3092 <b>squash<\/b> \u306b\u66f8\u304d\u63db\u3048\u3066\u4e0a\u66f8\u304d\u4fdd\u5b58\u3059\u308b\u3002<\/p>\n<h3>Y. \u30b3\u30df\u30c3\u30c8\u3092\u3084\u308a\u76f4\u3059\u3002<\/h3>\n<p>\u904e\u53bb\u306e\u3044\u305a\u308c\u304b\u306e\u30b3\u30df\u30c3\u30c8\u3092\u5225\u306e\u30b3\u30df\u30c3\u30c8\uff08\u4fee\u6b63\uff09\u306b\u5dee\u3057\u66ff\u3048\u308b\u3002\u30ea\u30d9\u30fc\u30b9\u306e\u7d50\u679c\u306f\u7570\u306a\u308b\u3002\u305f\u3060\u3057\u3001\u30b3\u30df\u30c3\u30c8\u30b3\u30e1\u30f3\u30c8\u300e\u3060\u3051\u300f\u3092\u5909\u66f4\u3057\u305f\u3068\u304d\u306f\u30ea\u30d9\u30fc\u30b9\u306e\u7d50\u679c\u306f\u540c\u4e00\u3067\u3042\u308b\u3002<\/p>\n<h4>1. \u4fee\u6b63\u3059\u308b\uff08\u3084\u308a\u76f4\u3059\uff09\u30b3\u30df\u30c3\u30c8\u3092\u6307\u5b9a\u3059\u308b\u3002<\/h4>\n<p>\u884c\u982d\u306e<b>pick<\/b> \u3092 <b>edit<\/b> \u306b\u66f8\u304d\u63db\u3048\u3066\u4e0a\u66f8\u304d\u4fdd\u5b58\u3059\u308b\u3002<\/p>\n<h4>2. \u7de8\u96c6\u3059\u308b\uff08\u4fee\u6b63\u3059\u308b\uff09\u3002<\/h4>\n<pre class=\"lang:sh highlight:0 decode:true \" >$ vim &lt;file&gt;<\/pre>\n<h4>3. \u4fee\u6b63\u3092\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u3059\u308b\u3002<\/h4>\n<pre class=\"lang:sh highlight:0 decode:true \" >$ git add &lt;file&gt;<\/pre>\n<h4>4. \u30b3\u30df\u30c3\u30c8\u3059\u308b\uff08\u4fee\u6b63\u3057\u305f\u5185\u5bb9\u3067\u30b3\u30df\u30c3\u30c8\u3092\u3084\u308a\u76f4\u3059\uff09\u3002<\/h4>\n<pre class=\"lang:sh highlight:0 decode:true \" >$ git commit --amend<\/pre>\n<h4>5. \u30ea\u30d9\u30fc\u30b9\u3092\u7d99\u7d9a\u3059\u308b\u3002<\/h4>\n<pre class=\"lang:sh highlight:0 decode:true \" >$ git rebase --continue<\/pre>\n<hr>\n<h3>\u5185\u90e8\u30ea\u30f3\u30af<\/h3>\n<ul>\n<li><a href=\"\/tech\/index.php\/archives\/7288\">[git] rebase<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>A. \u76f4\u524d\uff08\uff11\u4e16\u4ee3\u524d\uff09\u306e\u30b3\u30df\u30c3\u30c8\u3092\u66f8\u304d\u63db\u3048\u308b 1. \u7de8\u96c6\u3059\u308b\uff08\u4fee\u6b63\u3059\u308b\uff09 $ vim &lt;file&gt; 2. \u4fee\u6b63\u3092\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u3059\u308b $ git add &lt;file&gt; 3. \u30b3\u30df\u30c3\u30c8\u3059\u308b\uff08\u4fee\u6b63\u3057\u305f\u5185\u5bb9 [&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-1430","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\/1430","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=1430"}],"version-history":[{"count":20,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/1430\/revisions"}],"predecessor-version":[{"id":7407,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/1430\/revisions\/7407"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=1430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=1430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=1430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}