{"id":9484,"date":"2020-03-07T07:26:50","date_gmt":"2020-03-06T22:26:50","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=9484"},"modified":"2024-11-09T08:42:57","modified_gmt":"2024-11-08T23:42:57","slug":"%e3%80%90git%e3%80%91%e3%80%8c%e3%83%aa%e3%83%99%e3%83%bc%e3%82%b9%e3%80%8d%e3%81%ab%e9%96%a2%e3%81%99%e3%82%8b%e7%9f%a5%e8%ad%98","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=9484","title":{"rendered":"\u3010Git\u3011\u300c\u30ea\u30d9\u30fc\u30b9(rebase)\u300d\u306b\u95a2\u3059\u308b\u77e5\u8b58\u3001\u30b3\u30df\u30c3\u30c8\u30ed\u30b0\u306e\u64cd\u4f5c"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Rebase and merge\uff08\u30ea\u30d9\u30fc\u30b9\uff09<\/h2>\n\n\n\n<p><span style=\"color: #ff0000;\"><b>\u5909\u66f4\u3092\u7d71\u5408\u3059\u308b\u969b\u306b\u5c65\u6b74\u3092\u7dba\u9e97\u306b\u6574\u3048\u308b\u305f\u3081\u306e\u6a5f\u80fd\u3067\u3059\u3002<\/b><\/span><\/p>\n\n\n\n<p>\u30c8\u30d4\u30c3\u30af\u30d6\u30e9\u30f3\u30c1\u306b\u5bfe\u3057\u3066\u30ea\u30d9\u30fc\u30b9\u3092\u884c\u3046\u3068\u6700\u65b0\u306e\u30d9\u30fc\u30b9\u30d6\u30e9\u30f3\u30c1\u304b\u3089<span style=\"color: #ff0000;\"><strong>\u3042\u305f\u304b\u3082\u30c8\u30d4\u30c3\u30af\u30d6\u30e9\u30f3\u30c1\u3092\u4f5c\u6210\u3057\u305f\u304b\u306e\u3088\u3046\u306a\u5c65\u6b74\u72b6\u614b\u3092\u4f5c\u308a\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\uff08\u30d6\u30e9\u30f3\u30c1\u306e\u57fa\u70b9\u3068\u306a\u308b\u30b3\u30df\u30c3\u30c8\u3092\u5225\u306e\u30b3\u30df\u30c3\u30c8\u306b\u79fb\u52d5\u3057\u307e\u3059\u3002\uff09<\/strong><\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u306a\u305c\u300c\u30ea\u30d9\u30fc\u30b9\u300d\u3068\u547c\u3076\u306e\u304b\uff1f<\/h2>\n\n\n\n<p>\u89aa\u30b3\u30df\u30c3\u30c8\uff08\u30d9\u30fc\u30b9\u3068\u306a\u308b\u30b3\u30df\u30c3\u30c8\uff09\u3092\u65b0\u305f\u3057\u304f\u4ed8\u3051\u66ff\u3048\u308b\u305f\u3081\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30de\u30fc\u30b8\u3068\u30ea\u30d9\u30fc\u30b9\u306e\u9055\u3044<\/h2>\n\n\n\n<p>\u3069\u3061\u3089\u3082<span style=\"color: #ff0000;\"><strong>\u30d6\u30e9\u30f3\u30c1\u306e\u7d71\u5408\u3092\u884c\u3046<\/strong><\/span>\u3068\u3044\u3046\u610f\u5473\u3067\u306f\u540c\u3058\u52d5\u4f5c\u306b\u306a\u308a\u307e\u3059\u3002<span style=\"color: #ff0000;\"><strong>\u5c65\u6b74\u304c\u4e00\u76f4\u7dda\u306b\u306a\u308b\u70b9<\/strong><\/span>\u304c\u901a\u5e38\u306e\u30de\u30fc\u30b8\u3068\u306f\u7570\u306a\u308b\u70b9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30de\u30fc\u30b8\u3068\u30ea\u30d9\u30fc\u30b9\u3067\u4f7f\u3044\u5206\u3051\u3067\u306f\u3069\u3046\u3059\u308c\u3070\u826f\u3044\u304b\u3002<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u57fa\u672c\u65b9\u91dd<\/h3>\n\n\n\n<p>\u57fa\u672c\u7684\u306b\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306a\u65b9\u91dd\u3067\u30de\u30fc\u30b8\u3068\u30ea\u30d9\u30fc\u30b9\u3092\u4f7f\u3044\u5206\u3051\u308b\u3068\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u30ea\u30d9\u30fc\u30b9\u3092\u4f7f\u3046\u30b1\u30fc\u30b9<\/h4>\n\n\n\n<ul>\n<li>\u30d7\u30c3\u30b7\u30e5\u3057\u3066\u3044\u306a\u3044\u30ed\u30fc\u30ab\u30eb\u306e\u5909\u66f4<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u30de\u30fc\u30b8\u3092\u4f7f\u3046\u30b1\u30fc\u30b9<\/h4>\n\n\n\n<ul>\n<li>\u30d7\u30c3\u30b7\u30e5\u3057\u3066\u3057\u307e\u3063\u305f\u30ed\u30fc\u30ab\u30eb\u306e\u5909\u66f4<\/li>\n\n\n\n<li>\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u304c\u767a\u751f\u3057\u305d\u3046\u306a\u5834\u5408<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u304c\u767a\u751f\u3057\u305d\u3046\u304b\u306e\u5224\u65ad\u65b9\u6cd5<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u4ed6\u306e\u4eba\u306e\u958b\u767a\u5185\u5bb9\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">\u30ed\u30fc\u30ab\u30eb\u306e\u5909\u66f4\u3092GitHub\u306b\u30d7\u30c3\u30b7\u30e5\u3057\u3066\u30d7\u30ea\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u4f5c\u6210\u3057\u3066\u3057\u307e\u3046\u3002<\/h4>\n\n\n\n<p>GitHub\u304c\u89aa\u5207\u306b\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u5224\u5b9a\u3057\u3066\u8868\u793a\u3057\u3066\u304f\u308c\u308b\u306e\u3067\u305d\u308c\u3067\u5224\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30de\u30fc\u30b8\u306e\u30e1\u30ea\u30c3\u30c8<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u4f5c\u696d\u306e\u5c65\u6b74\u3092\u7d30\u304b\u304f\u6b8b\u305b\u308b\u3002\uff08\u30ea\u30d9\u30fc\u30b9\u304b\u30de\u30fc\u30b8\u304b\u9078\u629e\u3059\u308b\u4e0a\u3067\u975e\u5e38\u306b\u91cd\u8981\u306a\u30dd\u30a4\u30f3\u30c8\u3067\u3059\u3002\uff09<\/h4>\n\n\n\n<p>\u30de\u30fc\u30b8\u3092\u4f7f\u3046\u4e0a\u3067\u6c7a\u3081\u624b\u3068\u306a\u308b\u306e\u306f\u3053\u306e\u70b9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u306e\u89e3\u6c7a\u304c\u6bd4\u8f03\u7684\u7c21\u5358<\/h4>\n\n\n\n<p><span style=\"color: #ff0000;\"><strong>\u30ea\u30d9\u30fc\u30b9\u306e\u5834\u5408\u306f\u3001\u30b3\u30df\u30c3\u30c8\u305d\u308c\u305e\u308c\u306b\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u3092\u89e3\u6d88\u3057\u3066\u3044\u304b\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044<\/strong><\/span>\u304c\u3001\u30de\u30fc\u30b8\u306e\u5834\u5408\u306f\u307e\u3068\u3081\u3066\u89e3\u6c7a\u3059\u308c\u3070\u826f\u3044\u3060\u3051\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30ea\u30d9\u30fc\u30b9\u306e\u30e1\u30ea\u30c3\u30c8<\/h3>\n\n\n\n<p>\u30b3\u30df\u30c3\u30c8\u306e\u6570\u304c\u6e1b\u308b\u306e\u3067\u5c65\u6b74\u304c\u7c21\u7d20\u306b\u306a\u308b\u3002\uff08\u30de\u30fc\u30b8\u30b3\u30df\u30c3\u30c8\u306e\u6570\u304c\u6e1b\u308b\uff09\u306a\u306e\u3067\u3001\u5c65\u6b74\u3092\u7c21\u6f54\u306b\u3059\u308b\u3053\u3068\u304c\u91cd\u8996\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306f\u30ea\u30d9\u30fc\u30b9\u3092\u9078\u629e\u3059\u308b\u3068\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30ea\u30d9\u30fc\u30b9\u306e\u7279\u5fb4<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u30e1\u30ea\u30c3\u30c8<\/h3>\n\n\n\n<ul>\n<li>\u4eee\u306b\u30c8\u30d4\u30c3\u30af\u30d6\u30e9\u30f3\u30c1\u306e\u6570\u304c\u5897\u3048\u305f\u3068\u3057\u3066\u3082\u30b3\u30df\u30c3\u30c8\u5c65\u6b74\u306f\u5e38\u306b\u4e00\u76f4\u7dda\u306b\u306a\u308a\u898b\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u30c7\u30e1\u30ea\u30c3\u30c8<\/h3>\n\n\n\n<ul>\n<li>\u904e\u53bb\u306e\u30b3\u30df\u30c3\u30c8\u5c65\u6b74\u3092\u6539\u7248\u3059\u308b\u70ba\u30b3\u30df\u30c3\u30c8 ID\u3082\u5909\u308f\u3063\u3066\u3057\u307e\u3046\u70ba\u3001\u666e\u901a\u306e\u65b9\u6cd5\u3067\u306f\u30d7\u30c3\u30b7\u30e5\u304c\u3067\u304d\u306a\u304f\u306a\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u30ea\u30d9\u30fc\u30b9\u5148\u306e\u30d6\u30e9\u30f3\u30c1\u304c\u8907\u6570\u30b3\u30df\u30c3\u30c8\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\uff11\u30b3\u30df\u30c3\u30c8\u305a\u3064\u8fbf\u3063\u3066\u3044\u304f\u6319\u52d5\u306b\u306a\u308b\u306e\u3067\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u3082\u305d\u306e\u90fd\u5ea6\u89e3\u6d88\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u70b9\uff08\u30de\u30fc\u30b8\u306e\u5834\u5408\u306f\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u306e\u89e3\u6d88\u306f\uff11\u5ea6\u3060\u3051\u3067\u6e08\u307f\u307e\u3059\u3002\uff09<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u30ea\u30d9\u30fc\u30b9\u306e\u7981\u6b62\u4e8b\u9805\uff1a\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3053\u3068\u304c\u8a00\u308f\u308c\u3066\u3044\u307e\u3059\u3002<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">GitHub\u306b\u30d7\u30c3\u30b7\u30e5\u3057\u305f\u30b3\u30df\u30c3\u30c8\u3092\u30ea\u30d9\u30fc\u30b9\u3057\u3066\u306f\u3044\u3051\u306a\u3044<\/h3>\n\n\n\n<p>GitHub\u306b\u4e00\u65e6\u30d7\u30c3\u30b7\u30e5\u3057\u3066\u3057\u307e\u3063\u305f\u30d6\u30e9\u30f3\u30c1\u3092\u30ed\u30fc\u30ab\u30eb\u3067\u30ea\u30d9\u30fc\u30b9\u3057\u3066\u518d\u5ea6\u30d7\u30c3\u30b7\u30e5\u3057\u3088\u3046\u3068\u3057\u305f\u3089<span style=\"color: #ff0000;\"><strong>\u30d7\u30c3\u30b7\u30e5\u81ea\u4f53\u304c\u3067\u304d\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/strong><span style=\"color: #000000;\">\u7406\u7531\u3068\u3057\u3066\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u300c\u30ea\u30e2\u30fc\u30c8\u3067\u7ba1\u7406\u3055\u308c\u3066\u3044\u308b\u30b3\u30df\u30c3\u30c8\u306e\u89aa\u5b50\u60c5\u5831\u300d\u3068\u300c\u30ed\u30fc\u30ab\u30eb\u3067\u7ba1\u7406\u3055\u308c\u3066\u3044\u308b\u30b3\u30df\u30c3\u30c8\u306e\u89aa\u5b50\u60c5\u5831\u300d\u304c\u7570\u306a\u3063\u3066\u3044\u308b<\/strong><\/span>\u3068\u30ea\u30e2\u30fc\u30c8\u3067\u8a8d\u8b58\u3055\u308c\u3066\u3057\u307e\u3046\u305f\u3081\u3067\u3059\u3002<\/span><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u300cgit push -f\u300d\u306f\u7d76\u5bfe\u306b\u4f7f\u308f\u306a\u3044\u3053\u3068<\/h3>\n\n\n\n<p>\u3053\u308c\u3092\u3059\u308b\u3068\u30ed\u30fc\u30ab\u30eb\u306e\u5c65\u6b74\u3067\u30ea\u30e2\u30fc\u30c8\u306e\u5c65\u6b74\u3092\u5b8c\u5168\u306b\u4e0a\u66f8\u304d\u3067\u304d\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u30ea\u30e2\u30fc\u30c8\u306e\u5c65\u6b74\u304c\u58ca\u308c\u3066\u3057\u307e\u3046\u3053\u3068\u3092\u610f\u5473\u3059\u308b\u306e\u3067\u30d7\u30c3\u30b7\u30e5\u3067\u304d\u306a\u3044\u304b\u3089\u3068\u8a00\u3063\u3066\u3053\u306e\u624b\u6bb5\u3092\u3068\u308b\u306e\u306f\u6b62\u3081\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u305f\u3060\u3001\u5b9f\u52d9\u3067\u306f\u5f37\u5236push\u304c\u57fa\u672c<\/h3>\n\n\n\n<p>\u305f\u3060\u3001\u5b9f\u52d9\u3067\u306f\u57fa\u672c\u7684\u306b\u306ffeature\u30d6\u30e9\u30f3\u30c1\u3067\u5404\u500b\u4eba\u304c\u4f5c\u696d\u3092\u3057\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3057\u3001\u5f37\u5236push\u3057\u3066\u3057\u307e\u3063\u3066\u3082\u554f\u984c\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>feature\u306b\u5bfe\u3057\u3066\u6700\u65b0\u306emaster\u306e\u5185\u5bb9\u3092\u53d6\u308a\u8fbc\u3080\u969b\u306brebase\u3059\u308b\u969b\u3082\u57fa\u672c\u6700\u65b0\u306e\u72b6\u614b\u3067\u53d6\u308a\u8fbc\u3093\u3067\u3044\u308b\u306e\u3067\u3001\u3053\u308c\u3082\u5f37\u5236push\u3057\u3066\u3057\u307e\u3063\u3066\u554f\u984c\u306a\u3044\u304b\u3068\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b3\u30de\u30f3\u30c9<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">git rebase &lt;\u30b3\u30df\u30c3\u30c8\u306e\u57fa\u70b9\u3068\u3057\u305f\u3044\u30d6\u30e9\u30f3\u30c1\u540d&gt;<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u4f8b<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">1.\u30c8\u30d4\u30c3\u30af\u30d6\u30e9\u30f3\u30c1\u306e\u57fa\u70b9\u3092master\u30d6\u30e9\u30f3\u30c1\u306e\u5148\u306b\u4ed8\u3051\u66ff\u3048\u308b\u3002<\/h4>\n\n\n\n<p>\u30b3\u30df\u30c3\u30c8\u306e\u57fa\u70b9\u304cmaster\u30d6\u30e9\u30f3\u30c1\u306e\u5148\u306b\u3064\u3051\u5909\u308f\u308b\u3060\u3051\u3067\u306a\u304f\u3001master\u30d6\u30e9\u30f3\u30c1\u306e\u5909\u66f4\u5185\u5bb9\u3082\u53d6\u308a\u8fbc\u307e\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">git checkout &lt;\u30c8\u30d4\u30c3\u30af\u30d6\u30e9\u30f3\u30c1&gt;\ngit rebase master<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">2.master\u30d6\u30e9\u30f3\u30c1\u3068\u30c8\u30d4\u30c3\u30af\u30d6\u30e9\u30f3\u30c1\u3092\u30de\u30fc\u30b8\u3059\u308b\u3002<\/h4>\n\n\n\n<p>\u30d5\u30a1\u30b9\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9\u3067\u306e\u30de\u30fc\u30b8\u306b\u306a\u308b\u306e\u3067\u65b0\u3057\u304f\u30b3\u30df\u30c3\u30c8\u304c\u4f5c\u3089\u308c\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3002\uff08\u3042\u304f\u307e\u3067\u81ea\u5206\u306e\u30d6\u30e9\u30f3\u30c1\u306e\u30b3\u30df\u30c3\u30c8\u3092\u4ed6\u4eba\u304c\u7de8\u96c6\u3057\u305f\u30b3\u30df\u30c3\u30c8\u306b\u5411\u304d\u5148\u3092\u5909\u3048\u308b\u52d5\u304d\u306b\u306a\u308a\u307e\u3059\u3002\uff09<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">git checkout master\ngit merge &lt;\u30c8\u30d4\u30c3\u30af\u30d6\u30e9\u30f3\u30c1&gt;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b3\u30df\u30c3\u30c8\u30ed\u30b0\u3092\u64cd\u4f5c<\/h2>\n\n\n\n<p>\u30b3\u30df\u30c3\u30c8\u3092\u4fee\u6b63\u3057\u305f\u3044\u5834\u5408\u306f\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">git rebase -i &lt;\u30b3\u30df\u30c3\u30c8ID&gt; \u3082\u3057\u304f\u306f HEAD~(\u3084\u308a\u76f4\u3057\u305f\u3044\u30b3\u30df\u30c3\u30c8\u6570)<\/pre>\n\n\n\n<p>\u3059\u308b\u3068\u4e0b\u8a18\u306e\u3088\u3046\u306b\u30a8\u30c7\u30a3\u30bf\u4e0a\u306b\u76f4\u8fd1\u306e\u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pick \u30b3\u30df\u30c3\u30c8ID \u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b81\npick \u30b3\u30df\u30c3\u30c8ID \u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b82\npick \u30b3\u30df\u30c3\u30c8ID \u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b83<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u30b3\u30df\u30c3\u30c8\u306e\u9806\u756a\u306e\u5165\u308c\u66ff\u3048<\/h3>\n\n\n\n<p>\u4e0a\u8a18\u3067\u8868\u793a\u3055\u308c\u305f\u30a8\u30c7\u30a3\u30bf\u4e0a\u306e\u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u9806\u756a\u3092\u5165\u308c\u66ff\u3048\u308b\u3060\u3051\u3067\u30b3\u30df\u30c3\u30c8\u30ed\u30b0\u306e\u9806\u756a\u307e\u3067\u5165\u308c\u66ff\u3048\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p>squash\u306f\u4e0a\u306e\u76f4\u524d\u306epick\u306b\u5438\u53ce\u3055\u308c\u308b\u6319\u52d5\u306b\u306a\u308b\u306e\u3067\u3001\u96e2\u308c\u305f\u30b3\u30df\u30c3\u30c8\u540c\u58eb\u3092\u7d71\u5408\u3057\u305f\u3044\u3068\u3044\u3046\u5834\u5408\u306b\u9806\u756a\u306e\u5165\u308c\u66ff\u3048\u306f\u4f7f\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30b3\u30df\u30c3\u30c8\u3092\u307e\u3068\u3081\u308b\u3002<\/h3>\n\n\n\n<p>pick \u2192 squash\u306b\u66f8\u304d\u63db\u3048\u308b\u3053\u3068\u3067\u305d\u306esquash\u306b\u66f8\u304d\u63db\u3048\u305f\u30b3\u30df\u30c3\u30c8\u304cpick\u306b\u7d71\u5408\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pick \u30b3\u30df\u30c3\u30c8ID \u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b81\nsquash \u30b3\u30df\u30c3\u30c8ID \u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b82\nsquash \u30b3\u30df\u30c3\u30c8ID \u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b83<\/pre>\n\n\n\n<p>vim\u3068\u540c\u3058\u30a8\u30c7\u30a3\u30bf\u304c\u958b\u304f\u306e\u3067\u7de8\u96c6\u5f8c\u306f\u300c:wq\u300d\u3067\u4fdd\u5b58\u3092\u3059\u308c\u3070rebase\u304c\u5b8c\u4e86\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u304c\u8d77\u304d\u305f\u5834\u5408\u306f\u3069\u3046\u3059\u308b\u304b\uff1f<\/h3>\n\n\n\n<p>pick1\u21e8pick2\u3068\u3044\u3046\u611f\u3058\u3067\u3001\u9806\u756a\u306b\u30b3\u30df\u30c3\u30c8\u304c\u5b9f\u884c\u3055\u308c\u308b\u306e\u3067\u305d\u306e\u969b\u306b\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u304c\u8d77\u304d\u305f\u5834\u5408\u306frebase\u304c\u5b8c\u4e86\u3057\u3066\u3044\u306a\u3044\u6271\u3044\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u969b\u306f\u3001\u4e00\u3064\u4e00\u3064\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u3092\u89e3\u6d88\u3057\u3066\u3044\u304f\u4f5c\u696d\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1.\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u89e3\u6d88\n2.git add (\u5bfe\u8c61\u306e\u30d5\u30a1\u30a4\u30eb)\n3.git rebase --continue<\/code><\/pre>\n\n\n\n<p>\u6ce8\u610f\u70b9\u3068\u3057\u3066\u306f\u3001\u901a\u5e38\u306e\u30b3\u30df\u30c3\u30c8\u3068\u540c\u3058\u3088\u3046\u306bgit commit \u3067\u306f\u306a\u304f\u3001git rebase --continue\u3092\u5b9f\u884c\u3059\u308b\u70b9\u3067\u3059\u3002\u6b21\u306e\u30b3\u30df\u30c3\u30c8\u306b\u79fb\u52d5\u3059\u308b\u3068\u3044\u3046\u610f\u5473\u306b\u306a\u308a\u307e\u3059\u3002continue\u3092\u5168\u3066\u5b8c\u4e86\u3057\u3066\u7279\u306b\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u304c\u8d77\u304d\u306a\u3051\u308c\u3070rebase\u306f\u5b8c\u4e86\u3057\u4ee5\u4e0b\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"798\" height=\"48\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2024\/11\/image.png\" alt=\"\" class=\"wp-image-23888\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2024\/11\/image.png 798w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2024\/11\/image-300x18.png 300w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2024\/11\/image-768x46.png 768w\" sizes=\"(max-width: 798px) 100vw, 798px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">rebase\u3084\u308a\u76f4\u3057\u305f\u3044\u5834\u5408<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u307e\u3060\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u304c\u8d77\u304d\u308b\u306a\u3069\u3057\u3066rebase\u4e2d\u3067\u3042\u308c\u3070<\/h4>\n\n\n\n<p>\u4ee5\u4e0b\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git rebase --abort<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u3059\u3067\u306brebase\u304c\u5b8c\u4e86\u3057\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u5834\u5408\u306f<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>git reflog\ngit reset --hard (\u623b\u308a\u305f\u3044id)<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8a18\u3067git\u306e\u5909\u66f4\u5c65\u6b74\u3092\u9061\u3063\u3066\u623b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30b3\u30df\u30c3\u30c8\u3092\u5206\u5272\u3059\u308b\u3002<\/h3>\n\n\n\n<p>\u5206\u5272\u3057\u305f\u3044\u30b3\u30df\u30c3\u30c8\u3092\u4e0b\u8a18\u306e\u3088\u3046\u306bedit\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">edit \u30b3\u30df\u30c3\u30c8ID \u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b81<\/pre>\n\n\n\n<p>\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">git reset HEAD^<\/pre>\n\n\n\n<p>\u3059\u308b\u3068\u6700\u65b0\u306e\u30b3\u30df\u30c3\u30c8\u304c\u53d6\u308a\u6d88\u3055\u308c\u3066\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u3059\u3089\u3082\u3055\u308c\u3066\u3044\u306a\u3044\u72b6\u614b\u306b\u30d5\u30a1\u30a4\u30eb\u304c\u623b\u308b\u306e\u3067\u3001\u30b3\u30df\u30c3\u30c8\u3092\u5206\u5272\u3057\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u3054\u3068\u306b\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u306b\u8ffd\u52a0\u3057\u305f\u308a\u3057\u3066\u30b3\u30df\u30c3\u30c8\u3092\u5206\u5272\u3057\u307e\u3059\u3002\u30b3\u30df\u30c3\u30c8\u304c\u5b8c\u4e86\u3057\u305f\u3089\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">git rebase --continue<\/pre>\n","protected":false},"excerpt":{"rendered":"Rebase and merge\uff08\u30ea\u30d9\u30fc\u30b9\uff09 \u5909\u66f4\u3092\u7d71\u5408\u3059\u308b\u969b\u306b\u5c65\u6b74\u3092\u7dba\u9e97\u306b\u6574\u3048\u308b\u305f\u3081\u306e\u6a5f\u80fd\u3067\u3059\u3002 \u30c8\u30d4\u30c3\u30af\u30d6\u30e9\u30f3\u30c1\u306b\u5bfe\u3057\u3066\u30ea\u30d9\u30fc\u30b9\u3092\u884c\u3046\u3068\u6700\u65b0\u306e\u30d9\u30fc\u30b9\u30d6\u30e9\u30f3\u30c1\u304b\u3089\u3042\u305f\u304b\u3082\u30c8\u30d4\u30c3\u30af\u30d6\u30e9\u30f3\u30c1\u3092\u4f5c\u6210\u3057\u305f\u304b\u306e\u3088\u3046\u306a\u5c65\u6b74\u72b6\u614b\u3092\u4f5c [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[32],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/9484"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9484"}],"version-history":[{"count":21,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/9484\/revisions"}],"predecessor-version":[{"id":23889,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/9484\/revisions\/23889"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9484"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}