{"id":2938,"date":"2015-05-22T16:37:48","date_gmt":"2015-05-22T07:37:48","guid":{"rendered":"http:\/\/aatljapan.wpengine.com\/?p=2938"},"modified":"2020-08-27T18:44:01","modified_gmt":"2020-08-27T09:44:01","slug":"force-with-lease","status":"publish","type":"post","link":"https:\/\/www.atlassian.com\/ja\/blog\/force-with-lease","title":{"rendered":"<code>--force<\/code> \u306f\u6709\u5bb3\u3060\u3068\u3044\u3046\u8003\u3048; git \u306e <code>--force-with-lease<\/code> \u3092\u7406\u89e3\u3059\u308b"},"content":{"rendered":"<p>Git \u306e <tt>push --force<\/tt> \u306f\u6709\u5bb3\u3067\u3059\u3002\u4f55\u6545\u306a\u3089\u30ed\u30fc\u30ab\u30eb\u306e\u5185\u5bb9\u3092\u7121\u6761\u4ef6\u306b\u30ea\u30e2\u30fc\u30c8\u30ec\u30dd\u30b8\u30c8\u30ea\u3092\u4e0a\u66f8\u304d\u3057\u3066\u3057\u307e\u3044\u3001\u30c1\u30fc\u30e0\u30e1\u30f3\u30d0\u30fc\u304c\u305d\u306e\u9593\u306b\u30d7\u30c3\u30b7\u30e5\u3057\u3066\u3044\u305f\u5909\u66f4\u3092\u4e0a\u66f8\u304d\u3066\u3057\u307e\u3046\u304b\u3089\u3067\u3059\u3002\u3057\u304b\u3057\u3001\u3053\u308c\u306b\u306f\u6539\u5584\u7b56\u304c\u3042\u308a\u307e\u3059\u3002\u5f37\u5236\u30d7\u30c3\u30b7\u30e5\u304c\u3069\u3046\u3057\u3066\u3082\u5fc5\u8981\u3067\u306f\u3042\u308b\u3051\u308c\u3069\u3001\u4ed6\u4eba\u306e\u4f5c\u696d\u3092\u4e0a\u66f8\u304d\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u305f\u3044\u3068\u304d\u306f <tt>--force-with-lease<\/tt> \u3068\u3044\u3046\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/aatljapan.wpengine.com\/files\/force-with-lease.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-medium wp-image-2939\" src=\"http:\/\/aatljapan.wpengine.com\/files\/force-with-lease-240x300.jpg\" alt=\"force-with-lease\" width=\"240\" height=\"300\" srcset=\"https:\/\/aatljapan.wpengine.com\/wp-content\/uploads\/force-with-lease-240x300.jpg 240w, https:\/\/aatljapan.wpengine.com\/wp-content\/uploads\/force-with-lease.jpg 400w\" sizes=\"auto, (max-width: 240px) 100vw, 240px\" \/><\/a><br \/>\nGit \u306e <tt>push --force<\/tt> \u306f\u5171\u6709\u30ec\u30dd\u30b8\u30c8\u30ea\u306b\u30d7\u30c3\u30b7\u30e5\u3055\u308c\u305f\u4ed6\u306e\u5909\u66f4\u3092\u7834\u58ca\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u306e\u3067\u3001\u5229\u7528\u3059\u3079\u304d\u3067\u306f\u306a\u3044\u3053\u3068\u306f\u826f\u304f\u77e5\u3089\u308c\u3066\u3044\u307e\u3059\u3002\u5e38\u306b\u5b8c\u5168\u306b\u5931\u308f\u308c\u308b\u3053\u3068\u306b\u306a\u3089\u306a\u304f\u3066\u3082 (\u3082\u3057\u5909\u66f4\u304c\u4ed6\u4eba\u306e\u30ef\u30fc\u30ad\u30f3\u30b0\u30c4\u30ea\u30fc\u306b\u5b58\u5728\u3057\u3066\u3044\u308c\u3070\u30de\u30fc\u30b8\u3059\u308b\u3053\u3068\u306f\u53ef\u80fd\u3067\u3059)\u3001\u3053\u308c\u306f\u7121\u5206\u5225\u306a\u5bfe\u51e6\u3067\u3042\u308a\u3001\u6700\u60aa\u306e\u5834\u5408\u306f\u5927\u304d\u306a\u640d\u5bb3\u3092\u62db\u304d\u307e\u3059\u3002\u4f55\u6545\u306a\u3089 <tt>--force<\/tt> \u3068\u3044\u3046\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u30d6\u30e9\u30f3\u30c1\u306e\u5148\u982d\u3092\u30ed\u30fc\u30ab\u30eb\u306e\u5c65\u6b74\u306b\u8a2d\u5b9a\u3057\u3001\u3053\u308c\u307e\u3067\u306e\u5168\u3066\u306e\u5909\u66f4\u3092\u7121\u8996\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u5f37\u5236\u30d7\u30c3\u30b7\u30e5\u306f\u3001\u30d6\u30e9\u30f3\u30c1\u3092\u30ea\u30d9\u30fc\u30b9(rebase)\u3057\u306a\u3051\u308c\u3070\u3044\u3051\u306a\u3044\u6642\u306b\u3088\u304f\u767a\u751f\u3057\u307e\u3059\u3002\u3053\u308c\u3092\u4f8b\u793a\u3059\u308b\u305f\u3081\u306b\u7c21\u6f54\u306a\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u3042\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u30a2\u30ea\u30b9\u3068\u30dc\u30d6\u304c\u4e00\u7dd2\u306b\u4f5c\u696d\u3092\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u30d5\u30a3\u30fc\u30c1\u30e3\u30fc\u30d6\u30e9\u30f3\u30c1\u304c\u3042\u308a\u307e\u3059\u3002\u5f7c\u3089\u4e8c\u4eba\u306f\u3053\u306e\u30ec\u30dd\u30b8\u30c8\u30ea\u3092\u30af\u30ed\u30fc\u30f3(clone)\u3057\u4f5c\u696d\u3092\u59cb\u3081\u307e\u3059\u3002<\/p>\n<p>\u30a2\u30ea\u30b9\u306f\u6700\u521d\u306b\u3053\u306e\u30d5\u30a3\u30fc\u30c1\u30e3\u30fc\u306b\u5bfe\u3057\u3066\u3001\u5f7c\u5973\u306e\u62c5\u5f53\u90e8\u5206\u3092\u5b8c\u4e86\u3055\u305b\u307e\u3057\u305f\u3002\u305d\u3057\u3066\u3053\u308c\u3092\u30e1\u30a4\u30f3\u306e\u30ec\u30dd\u30b8\u30c8\u30ea\u306b\u307e\u3067\u30d7\u30c3\u30b7\u30e5\u3057\u307e\u3057\u305f\u3002\u3053\u3053\u307e\u3067\u306f\u4f55\u306e\u554f\u984c\u3082\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u30dc\u30d6\u3082\u5f7c\u306e\u4f5c\u696d\u3092\u7d42\u3048\u307e\u3057\u305f\u3001\u3057\u304b\u3057\u3001\u305d\u308c\u3092\u30d7\u30c3\u30b7\u30e5\u3059\u308b\u524d\u306b\u5f7c\u306f\u3044\u304f\u3064\u304b\u306e\u5909\u66f4\u304c\u30de\u30b9\u30bf\u30fc\u30d6\u30e9\u30f3\u30c1\u4e0a\u306b\u30de\u30fc\u30b8\u3055\u308c\u305f\u3053\u3068\u306b\u6c17\u4ed8\u304d\u307e\u3057\u305f\u3002\u30dc\u30d6\u306f\u304d\u308c\u3044\u306a\u30c4\u30ea\u30fc\u3092\u7dad\u6301\u3057\u305f\u304b\u3063\u305f\u306e\u3067\u3001\u30de\u30b9\u30bf\u30fc\u30d6\u30e9\u30f3\u30c1\u306b\u5bfe\u3057\u3066\u30ea\u30d9\u30fc\u30b9\u3092\u5b9f\u884c\u3057\u307e\u3057\u305f\u3002\u305d\u3046\u3059\u308b\u3068\u3001\u3053\u306e\u30ea\u30d9\u30fc\u30b9\u3055\u308c\u305f\u30d6\u30e9\u30f3\u30c1\u306b\u30bd\u30fc\u30b9\u306e\u30d7\u30c3\u30b7\u30e5\u306f\u62d2\u5426\u3055\u308c\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u30a2\u30ea\u30b9\u304c\u3059\u3067\u306b\u5f7c\u5973\u306e\u4f5c\u696d\u3092\u30d7\u30c3\u30b7\u30e5\u3057\u3066\u3044\u305f\u3053\u3068\u3092\u6c17\u4ed8\u304b\u305a\u306b\u3001\u5f7c\u306f <tt>push --force<\/tt> \u3092\u884c\u3044\u307e\u3057\u305f\u3002\u4e0d\u5e78\u306a\u3053\u3068\u306b\u3001\u3053\u308c\u306f\u30aa\u30ea\u30b8\u30ca\u30eb\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u5185\u306e\u30a2\u30ea\u30b9\u306e\u5909\u66f4\u306e\u5168\u3066\u306e\u8a18\u9332\u3092\u524a\u9664\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u306e\u554f\u984c\u306f\u3001\u30dc\u30d6\u304c\u5f37\u5236\u30d7\u30c3\u30b7\u30e5\u3092\u3059\u308b\u969b\u306b\u3001\u306a\u305c\u81ea\u5206\u306e\u5909\u66f4\u304c\u62d2\u5426\u3055\u308c\u305f\u306e\u304b\u3092\u77e5\u3089\u306a\u304b\u3063\u305f\u3053\u3068\u3067\u3059\u3002\u305d\u306e\u7d50\u679c\u3001\u5f7c\u306f\u3053\u308c\u304c\u30ea\u30d9\u30fc\u30b9\u306e\u305b\u3044\u3060\u3068\u63a8\u6e2c\u3057\u3001\u30a2\u30ea\u30b9\u306e\u5909\u66f4\u306b\u3088\u308b\u3082\u306e\u3060\u3068\u306f\u8003\u3048\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u3053\u308c\u304c\u5171\u6709\u30d6\u30e9\u30f3\u30c1\u5185\u306b\u304a\u3044\u3066 <tt>--force<\/tt> \u306f\u7d76\u5bfe\u306b\u884c\u3063\u3066\u306f\u884c\u3051\u306a\u3044\u7406\u7531\u3067\u3059\u3002\u5171\u6709\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u30d6\u30e9\u30f3\u30c1\u306e\u4e2d\u592e\u30ea\u30dd\u30b8\u30c8\u30ea\u578b\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u3067\u306f\u5229\u7528\u3059\u308b\u3079\u304d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001<tt>--force<\/tt> \u306b\u306f\u4f59\u308a\u77e5\u3089\u308c\u3066\u3044\u306a\u3044\u985e\u4f3c\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3092\u5229\u7528\u3059\u308b\u3068\u5f37\u5236\u66f4\u65b0\u306b\u3088\u308b\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u7834\u58ca\u3092\u90e8\u5206\u7684\u306b\u4fdd\u8b77\u3057\u3066\u304f\u308c\u307e\u3059\u3002\u3053\u308c\u304c <tt>--force-with-lease<\/tt> \u3067\u3059\u3002<\/p>\n<p>\u3053\u306e <tt>--force-with-lease<\/tt> \u306f\u8ab0\u3082\u30d6\u30e9\u30f3\u30c1\u306e\u30a2\u30c3\u30d7\u30b9\u30c8\u30ea\u30fc\u30e0\u3092\u5909\u66f4\u3057\u3066\u3044\u306a\u3044\u306a\u3069\u3001\u671f\u5f85\u3055\u308c\u305f\u72b6\u6cc1\u306b\u306a\u3089\u306a\u3044\u9650\u308a\u306f\u30d6\u30e9\u30f3\u30c1\u3078\u306e\u66f4\u65b0\u3092\u62d2\u5426\u3057\u307e\u3059\u3002\u5b9f\u969b\u306b\u306f\u3001\u30a2\u30c3\u30d7\u30b9\u30c8\u30ea\u30fc\u30e0\u3078\u306e\u53c2\u7167\u304c\u671f\u5f85\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u3067\u3042\u308b\u304b\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u52d5\u4f5c\u3057\u307e\u3059\u3002git \u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306f\u30cf\u30c3\u30b7\u30e5\u5024\u3068\u306a\u3063\u3066\u304a\u308a\u3001\u6697\u306b\u3053\u308c\u307e\u3067\u306e\u5024\u3092\u30c1\u30a7\u30fc\u30f3\u3068\u3057\u305f\u3082\u306e\u3092\u30a8\u30f3\u30b3\u30fc\u30c9\u3057\u3066\u683c\u7d0d\u3057\u3066\u3044\u308b\u304b\u3089\u3067\u3059\u3002<\/p>\n<p><tt>--force-with-lease<\/tt> \u304c\u5b9f\u969b\u306b\u4f55\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u304b\u306f\u308f\u304b\u3063\u305f\u304b\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u73fe\u5728\u306e\u30ea\u30e2\u30fc\u30c8\u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3092\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059\u3002\u3053\u308c\u304c\u5b9f\u969b\u306e\u3068\u3053\u308d\u4f55\u3092\u610f\u5473\u3059\u308b\u304b\u3068\u8a00\u3046\u3068\u3001\u30a2\u30ea\u30b9\u304c\u81ea\u5206\u306e\u30d6\u30e9\u30f3\u30c1\u3092\u66f4\u65b0\u3057\u305d\u308c\u3092\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u30d7\u30c3\u30b7\u30e5\u3059\u308b\u3068\u3001\u3053\u306e\u30d6\u30e9\u30f3\u30c1\u306e HEAD \u3092\u793a\u3059\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9 \u304c\u66f4\u65b0\u3055\u308c\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002\u3053\u308c\u306b\u3088\u3063\u3066\u3001\u30dc\u30d6\u304c\u30ea\u30e2\u30fc\u30c8\u304b\u3089\u30d7\u30eb\u3057\u306a\u3044\u9650\u308a\u3001\u5f7c\u306e\u30ea\u30e2\u30fc\u30c8\u3078\u306e\u30ed\u30fc\u30ab\u30eb\u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306f\u671f\u9650\u5207\u308c\u306b\u306a\u308a\u307e\u3059\u3002\u5f7c\u304c <tt>--force-with-lease<\/tt> \u3092\u4f7f\u3063\u3066\u30d7\u30c3\u30b7\u30e5\u3092\u3059\u308b\u969b\u3001 git \u306f\u65b0\u3057\u3044\u30ea\u30e2\u30fc\u30c8\u306b\u5bfe\u3057\u3066\u30ed\u30fc\u30ab\u30eb\u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3001\u30d7\u30c3\u30b7\u30e5\u306e\u5f37\u5236\u3092\u62d2\u5426\u3057\u307e\u3059\u3002<tt>--force-with-lease<\/tt> \u306f\u305d\u306e\u9593\u8ab0\u3082\u5909\u66f4\u3092\u30ea\u30e2\u30fc\u30c8\u306b\u30d7\u30c3\u30b7\u30e5\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306e\u307f\u3001\u52b9\u7387\u7684\u306b\u5f37\u5236\u30d7\u30c3\u30b7\u30e5\u3092\u8a31\u53ef\u3057\u307e\u3059\u3002\u3053\u308c\u306f <tt>--force<\/tt> \u306b\u30b7\u30fc\u30c8\u30d9\u30eb\u30c8\u3092\u88c5\u7740\u3055\u305b\u308b\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002\u7c21\u6f54\u306a\u30c7\u30e2\u30f3\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u3053\u308c\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u3055\u305b\u308b\u52a9\u3051\u3068\u306a\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\uff1a<\/p>\n<p>\u30a2\u30ea\u30b9\u304c\u30d6\u30e9\u30f3\u30c1\u306b\u3044\u304f\u3064\u304b\u306e\u5909\u66f4\u3092\u52a0\u3048\u3001\u30e1\u30a4\u30f3\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u30d7\u30c3\u30b7\u30e5\u3057\u307e\u3057\u305f\u3002\u3057\u304b\u3057\u3053\u3053\u3067\u30dc\u30d6\u304c\u30de\u30b9\u30bf\u30fc\u306b\u5bfe\u3057\u3066\u30d6\u30e9\u30f3\u30c1\u3092\u30ea\u30d9\u30fc\u30b9\u3057\u307e\u3059\uff1a<\/p>\n<blockquote><p>ssmith$ git rebase master<\/p>\n<p>First, rewinding head to replay your work on top of it&#8230;<\/p>\n<p>Applying: Dev commit #1<\/p>\n<p>Applying: Dev commit #2<\/p>\n<p>Applying: Dev commit #3<\/p><\/blockquote>\n<p>\u30ea\u30d9\u30fc\u30b9\u3055\u308c\u305f\u306e\u3067\u3001\u5f7c\u306f\u30d7\u30c3\u30b7\u30e5\u3057\u3088\u3046\u3068\u8a66\u307f\u307e\u3059\u3002\u3057\u304b\u3057\u3053\u308c\u304c\u30a2\u30ea\u30b9\u306e\u4f5c\u696d\u3092\u4e0a\u66f8\u304d\u3057\u3066\u3057\u307e\u3046\u306e\u3067\u30b5\u30fc\u30d0\u30fc\u304c\u62d2\u5426\u3057\u307e\u3059\u3002<\/p>\n<blockquote><p>ssmith$ git push<\/p>\n<p>To \/tmp\/repo<\/p>\n<p>! [rejected] dev -&gt; dev (fetch first)<\/p>\n<p>error: failed to push some refs to &#8216;\/tmp\/repo&#8217;<\/p>\n<p>hint: Updates were rejected because the remote contains work that you do<\/p>\n<p>hint: not have locally. This is usually caused by another repository pushing<\/p>\n<p>hint: to the same ref. You may want to first integrate the remote changes<\/p>\n<p>hint: (e.g., &#8216;git pull &#8230;&#8217;) before pushing again.<\/p>\n<p>hint: See the &#8216;Note about fast-forwards&#8217; in &#8216;git push &#8211;help&#8217; for details.<\/p><\/blockquote>\n<p>\u3057\u304b\u3057\u30dc\u30d6\u306f\u3053\u308c\u304c\u30ea\u30d9\u30fc\u30b9\u306e\u305b\u3044\u3060\u3068\u63a8\u6e2c\u3059\u308b\u306e\u3067\u3001\u3068\u306b\u304b\u304f\u30d7\u30c3\u30b7\u30e5\u3057\u3088\u3046\u3068\u3057\u307e\u3059\u3002<\/p>\n<blockquote><p>ssmith$ git push &#8211;force<\/p>\n<p>To \/tmp\/repo<\/p>\n<p>+ f82f59e&#8230;c27aff1 dev -&gt; dev (forced update)<\/p><\/blockquote>\n<p>\u3057\u304b\u3057\u3001\u3082\u3057\u5f7c\u304c <tt>--force-with-lease<\/tt> \u3092\u4f7f\u3063\u3066\u3044\u305f\u5834\u5408\u3001\u3053\u308c\u3068\u306f\u7570\u306a\u308b\u7d50\u679c\u3092\u5f97\u3066\u3044\u305f\u3053\u3068\u3067\u3057\u3087\u3046\u3002 \u30dc\u30d6\u304c\u6700\u5f8c\u306b\u30d5\u30a7\u30c3\u30c1\u3057\u3066\u304b\u3089\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u304c\u5b9f\u969b\u306b\u306f\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3055\u308c\u3066\u306f\u3044\u306a\u304b\u3063\u305f\u3053\u3068\u304c git \u306b\u3088\u3063\u3066\u30c1\u30a7\u30c3\u30af\u3055\u308c\u3066\u3044\u305f\u304b\u3089\u3067\u3059\u3002<\/p>\n<blockquote><p>ssmith$ git push -n &#8211;force-with-lease<\/p>\n<p>To \/tmp\/repo<\/p>\n<p>! [rejected] dev -&gt; dev (stale info)<\/p>\n<p>error: failed to push some refs to &#8216;\/tmp\/repo&#8217;<\/p><\/blockquote>\n<p>\u3082\u3061\u308d\u3093\u3001 git \u306f \u8b66\u544a\u3092\u8868\u793a\u3057\u307e\u3059\u3002\u57fa\u672c\u7684\u306b\u306f\u30a2\u30ea\u30b9\u304c\u65e2\u306b\u5f7c\u5973\u306e\u5909\u66f4\u3092\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u30d7\u30c3\u30b7\u30e5\u3057\u3066\u3044\u305f\u5834\u5408\u306b\u306e\u307f\u6a5f\u80fd\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u5225\u306b\u6df1\u523b\u306a\u554f\u984c\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u3057\u304b\u3057\u3001\u5f7c\u5973\u304c\u30ea\u30d9\u30fc\u30b9\u3055\u308c\u305f\u30d6\u30e9\u30f3\u30c1\u3092\u30d7\u30eb\u3059\u308b\u3068\u304d\u3001\u81ea\u5206\u306e\u5909\u66f4\u3092\u30de\u30fc\u30b8\u3059\u308b\u3088\u3046\u306b\u4fc3\u3055\u308c\u307e\u3059\u3002\u3082\u3057\u671b\u3080\u306a\u3089\u3001\u5f7c\u5973\u304c\u81ea\u5206\u306e\u4f5c\u696d\u3092\u30ea\u30d9\u30fc\u30b9\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3088\u308a\u3082\u76ee\u7acb\u305f\u306a\u3044\u554f\u984c\u3067\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u30d6\u30e9\u30f3\u30c1\u304c\u4fee\u6b63\u3055\u308c\u3066\u3044\u308b\u306b\u3082\u95a2\u308f\u3089\u305a\u3001\u4fee\u6b63\u3055\u308c\u3066\u3044\u306a\u3044\u3068 git \u304c\u8a8d\u8b58\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u901a\u5e38\u306e\u4f7f\u7528\u6cd5\u306b\u304a\u3044\u3066\u3053\u306e\u3088\u3046\u306a\u3053\u3068\u304c\u8d77\u304d\u3066\u3057\u307e\u3046\u65b9\u6cd5\u3068\u306f\u3001\u30dc\u30d6\u304c\u5f7c\u306e\u30ed\u30fc\u30ab\u30eb\u30b3\u30d4\u30fc\u3092\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3059\u308b\u3068\u304d\u306b <tt>git pull<\/tt> \u3088\u308a\u3082 <tt>git fetch<\/tt> \u3092\u3080\u3057\u308d\u4f7f\u7528\u3057\u305f\u3088\u3046\u306a\u5834\u5408\u3067\u3059\u3002\u3053\u306e\u30d5\u30a7\u30c3\u30c1\u306f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u53c2\u7167\u3092\u30ea\u30e2\u30fc\u30c8\u304b\u3089\u30d7\u30eb\u3057\u3066\u304f\u308c\u307e\u3059\u304c\u3001\u30de\u30c3\u30c1\u30f3\u30b0\u304c\u7121\u3051\u308c\u3070 \u30de\u30fc\u30b8\u306f\u30ef\u30fc\u30ad\u30f3\u30b0\u30c4\u30ea\u30fc\u3092\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u3066\u306f\u304f\u308c\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001\u30ea\u30e2\u30fc\u30c8\u306e\u30ef\u30fc\u30ad\u30f3\u30b0\u30b3\u30d4\u30fc\u304c\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306b\u932f\u899a\u3055\u305b\u307e\u3059\u3002\u305d\u3057\u3066\u3053\u306e\u30ea\u30e2\u30fc\u30c8\u306b\u306f\u65b0\u3057\u3044\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u5b9f\u969b\u306b\u306f\u542b\u307e\u308c\u305a\u3001\u305d\u3057\u3066 <tt>--force-with-lease<\/tt> \u306b\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u3092\u4e0a\u66f8\u304d\u3055\u305b\u308b\u3088\u3046\u306b\u932f\u899a\u3055\u305b\u308b\u3082\u306e\u3067\u3059\u3002\u3053\u308c\u306f\u4ee5\u4e0b\u306e\u4f8b\u306b\u898b\u3089\u308c\u307e\u3059\uff1a<\/p>\n<blockquote><p>ssmith$ git push &#8211;force-with-lease<\/p>\n<p>To \/tmp\/repo<\/p>\n<p>! [rejected] dev -&gt; dev (stale info)<\/p>\n<p>error: failed to push some refs to &#8216;\/tmp\/repo&#8217;<\/p>\n<p>ssmith$ git fetch<\/p>\n<p>remote: Counting objects: 3, done.<\/p>\n<p>remote: Compressing objects: 100% (3\/3), done.<\/p>\n<p>remote: Total 3 (delta 0), reused 0 (delta 0)<\/p>\n<p>Unpacking objects: 100% (3\/3), done.<\/p>\n<p>From \/tmp\/repo<\/p>\n<p>1a3a03f..d7cda55 dev -&gt; origin\/dev<\/p>\n<p>ssmith$ git push &#8211;force-with-lease<\/p>\n<p>Counting objects: 9, done.<\/p>\n<p>Delta compression using up to 8 threads.<\/p>\n<p>Compressing objects: 100% (6\/6), done.<\/p>\n<p>Writing objects: 100% (9\/9), 845 bytes | 0 bytes\/s, done.<\/p>\n<p>Total 9 (delta 0), reused 0 (delta 0)<\/p>\n<p>To \/tmp\/repo<\/p>\n<p>d7cda55..b57fc84 dev -&gt; dev<\/p><\/blockquote>\n<p>\u3053\u306e\u554f\u984c\u306b\u5bfe\u3059\u308b\u6700\u3082\u30b7\u30f3\u30d7\u30eb\u306a\u89e3\u6c7a\u7b56\u306f\u5358\u7d14\u306b\u300c\u30de\u30fc\u30b8 (merge) \u306a\u3057\u306b \u30d5\u30a7\u30c3\u30c1 (fetch) \u306f\u3059\u308b\u306a\u300d(\u3042\u308b\u3044\u306f\u3088\u308a\u4e00\u822c\u7684\u306b\u306f\u4e21\u65b9\u3092\u884c\u3063\u3066\u304f\u308c\u308b\u30d7\u30eb\u3092\u3057\u308d\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059)\u3001\u3057\u304b\u3057\u3044\u308d\u3044\u308d\u306a\u72b6\u6cc1\u306b\u3088\u3063\u3066 <tt>--force-with-lease<\/tt> \u3092\u4f34\u3046\u30d7\u30c3\u30b7\u30e5\u306e\u524d\u306b\u30d5\u30a7\u30c3\u30c1\u3092\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3088\u3046\u306a\u5834\u5408\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u305d\u306e\u3088\u3046\u306a\u5834\u5408\u306e\u305f\u3081\u306b\u305d\u308c\u3092\u5b89\u5168\u306b\u884c\u3046\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002git \u306b\u306f\u305f\u304f\u3055\u3093\u3042\u308a\u307e\u3059\u304c\u3001\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u3068\u3063\u3066\u306e\u305f\u3060\u306e\u6063\u610f\u7684\u306a\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306b\u904e\u304e\u307e\u305b\u3093\u3002\u305d\u3046\u3044\u3046\u3053\u3068\u3067\u3042\u308c\u3070\u79c1\u305f\u3061\u306f\u81ea\u5206\u305f\u3061\u3067\u305d\u308c\u3092\u4f5c\u3063\u3066\u3084\u308c\u3070\u3044\u3044\u306e\u3067\u3059\u3002\u3053\u306e\u30b1\u30fc\u30b9\u3067\u306f\u30ea\u30e2\u30fc\u30c8\u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306e &#8220;save-point&#8221; \u30b3\u30d4\u30fc\u3092\u30d5\u30a7\u30c3\u30c1\u3092\u5b9f\u884c\u3059\u308b\u524d\u306b\u4f5c\u3063\u3066\u3084\u308c\u3070\u3044\u3044\u306e\u3067\u3059\u3002\u305d\u308c\u304b\u3089\u79c1\u305f\u3061\u306f <tt>--force-with-lease<\/tt> \u306b\u3053\u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3092\u66f4\u65b0\u3055\u308c\u305f\u30ea\u30e2\u30fc\u30c8\u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3068\u3057\u3066\u3068\u3044\u3046\u3088\u308a\u3082\u671f\u5f85\u3057\u3066\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u547d\u4ee4\u3059\u308c\u3070\u3044\u3044\u306e\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u3059\u308b\u305f\u3081\u306b\u79c1\u305f\u3061\u306f git \u306e <tt>update-ref<\/tt> \u6a5f\u80fd\u3092\u4f7f\u3063\u3066\u3001\u65b0\u3057\u3044\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3092\u4f5c\u308a\u3001\u3069\u3093\u306a\u30ea\u30d9\u30fc\u30b9\u3084\u30d5\u30a7\u30c3\u30c1\u306e\u30aa\u30da\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u524d\u3067\u3082\u30ea\u30e2\u30fc\u30c8\u306e\u72b6\u614b\u3092\u4fdd\u5b58\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u3053\u308c\u3067\u52b9\u7387\u3088\u304f\u79c1\u305f\u3061\u304c\u5f37\u5236\u30d7\u30c3\u30b7\u30e5\u3092\u30ea\u30e2\u30fc\u30c8\u306b\u3059\u308b\u4f5c\u696d\u3092\u306f\u3058\u3081\u308b\u30dd\u30a4\u30f3\u30c8\u3092\u30d6\u30c3\u30af\u30de\u30fc\u30af\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3088\u3063\u3066\u79c1\u305f\u3061\u306f\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1 <tt>dev<\/tt> \u306e\u72b6\u614b\u3092 <tt>dev-pre-rebase<\/tt> \u3068\u547c\u3070\u308c\u308b\u65b0\u3057\u3044 ref \u306b\u4fdd\u5b58\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3059\uff1a<\/p>\n<blockquote>\n<pre><code>ssmith$ git update-ref refs\/dev-pre-rebase refs\/remotes\/origin\/dev<\/code><\/pre>\n<\/blockquote>\n<p>\u3053\u306e\u6642\u70b9\u3067\u79c1\u305f\u3061\u306f\u30ea\u30d9\u30fc\u30b9\u3068\u30d5\u30a7\u30c3\u30c1\u3092\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u305d\u308c\u304b\u3089\u4fdd\u5b58\u3055\u308c\u305f\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3092\u4f7f\u7528\u3057\u3066\u3001\u79c1\u305f\u3061\u304c\u4f5c\u696d\u3092\u3057\u3066\u3044\u308b\u6642\u306b\u8ab0\u304b\u304c\u5909\u66f4\u3092\u30d7\u30c3\u30b7\u30e5\u3057\u3066\u3044\u308b\u3088\u3046\u306a\u5834\u5408\u306b\u3001\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u5b88\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<blockquote><p>ssmith$ git rebase master<\/p>\n<p>First, rewinding head to replay your work on top of it&#8230;<\/p>\n<p>Applying: Dev commit #1<\/p>\n<p>Applying: Dev commit #2<\/p>\n<p>Applying: Dev commit #3<\/p>\n<p>ssmith$ git fetch<\/p>\n<p>remote: Counting objects: 3, done.<\/p>\n<p>remote: Compressing objects: 100% (3\/3), done.<\/p>\n<p>remote: Total 3 (delta 0), reused 0 (delta 0)<\/p>\n<p>Unpacking objects: 100% (3\/3), done.<\/p>\n<p>From \/tmp\/repo<\/p>\n<p>2203121..a9a35b3 dev -&gt; origin\/dev<\/p>\n<p>ssmith$ git push &#8211;force-with-lease=dev:refs\/dev-pre-rebase<\/p>\n<p>To \/tmp\/repo<\/p>\n<p>! [rejected] dev -&gt; dev (stale info)<\/p>\n<p>error: failed to push some refs to &#8216;\/tmp\/repo&#8217;<\/p><\/blockquote>\n<p>\u3053\u308c\u3067\u308f\u304b\u3063\u305f\u3088\u3046\u306b\u3001<tt>--force-with-lease<\/tt> \u306f\u5f37\u5236\u30d7\u30c3\u30b7\u30e5\u3092\u4f7f\u3046\u6a5f\u4f1a\u306e\u3042\u308b git \u30e6\u30fc\u30b6\u30fc\u306b\u3068\u3063\u3066\u306f\u4fbf\u5229\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002\u3057\u304b\u3057\u3053\u308c\u304c <tt>--force<\/tt> \u306e\u5168\u3066\u306e\u30ea\u30b9\u30af\u3092\u89e3\u6c7a\u3059\u308b\u4e07\u80fd\u85ac\u3067\u3042\u308b\u3068\u306f\u8a00\u3044\u96e3\u304f\u3001\u6700\u521d\u306b\u3053\u308c\u304c\u3069\u306e\u3088\u3046\u306b\u5185\u90e8\u3067\u6a5f\u80fd\u3059\u308b\u306e\u304b\u3001\u307e\u305f\u3053\u306e \u8b66\u544a\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u7406\u89e3\u3057\u306a\u3044\u3046\u3061\u306f\u4f7f\u308f\u306a\u3044\u65b9\u304c\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u30c7\u30d9\u30ed\u30c3\u30d1\u30fc\u3089\u304c\u6642\u6298\u306e\u30ea\u30d9\u30fc\u30b9\u3092\u4f34\u3046\u3001\u5358\u306b\u30d7\u30c3\u30b7\u30e5\u3068\u30d7\u30eb\u3092\u3059\u308b\u3088\u3046\u306a\u30ce\u30fc\u30de\u30eb\u3067\u6700\u3082\u4e00\u822c\u7684\u306a\u4f7f\u7528\u4f8b\u306e\u5834\u5408\u3001\u3053\u308c\u306f\u30c0\u30e1\u30fc\u30b8\u3092\u4e0e\u3048\u308b\u3088\u3046\u306a\u5f37\u5236\u30d7\u30c3\u30b7\u30e5\u306b\u5bfe\u3057\u3066\u5fc5\u8981\u306a\u4fdd\u8b77\u3092\u63d0\u4f9b\u3059\u308b\u3082\u306e\u3067\u3059\u3002\u3053\u306e\u3088\u3046\u306a\u7406\u7531\u306b\u3088\u308a\u3001\u79c1\u306f\u5c06\u6765\u306e git (\u304a\u305d\u3089\u304f 3.0 \u307e\u3067\u306f\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u304c) \u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u304a\u3044\u3066\u3001\u3053\u308c\u304c <tt>--force<\/tt> \u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u52d5\u4f5c\u306b\u306a\u3063\u3066\u3044\u308b\u3068\u3044\u3044\u306a\u3068\u9858\u3063\u3066\u3044\u307e\u3059\u3002\u305d\u3057\u3066\u73fe\u5728\u306e\u52d5\u4f5c\u304c <tt>--force-replace-remote<\/tt> \u306e\u3088\u3046\u306a\u5b9f\u969b\u306e\u52d5\u4f5c\u3092\u793a\u3059\u3088\u3046\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u79fb\u7ba1\u3055\u308c\u308c\u3070\u826f\u3044\u3068\u3082\u9858\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><small><br \/>\n*\u672c\u30d6\u30ed\u30b0\u306f Atlassian Developers \u306e\u7ffb\u8a33\u3067\u3059\u3002\u672c\u6587\u4e2d\u306e\u65e5\u6642\u306a\u3069\u306f\u6295\u7a3f\u5f53\u6642\u306e\u3082\u306e\u3067\u3059\u306e\u3067\u3054\u4e86\u627f\u304f\u3060\u3055\u3044\u3002<br \/>\n*\u539f\u6587 : 2015 \u5e74 4 \u6708 29 \u65e5\u6295\u7a3f \"<a href=\"https:\/\/developer.atlassian.com\/blog\/2015\/04\/force-with-lease\/\" target=\"_blank\" rel=\"noopener noreferrer\"><tt>--force considered harmful; understanding git's --force-with-lease<\/tt><\/a>\"<br \/>\n<\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Git \u306e push &#8211;force \u306f\u6709\u5bb3\u3067\u3059\u3002\u4f55\u6545\u306a\u3089\u30ed\u30fc\u30ab\u30eb\u306e\u5185\u5bb9\u3092\u7121\u6761\u4ef6\u306b\u30ea\u30e2\u30fc\u30c8\u30ec\u30dd\u30b8\u30c8\u30ea\u3092\u4e0a\u66f8\u304d\u3057\u3066\u3057\u307e\u3044\u3001\u30c1\u30fc\u30e0\u30e1\u30f3\u30d0\u30fc\u304c\u305d\u306e\u9593\u306b\u30d7\u30c3\u30b7\u30e5\u3057\u3066\u3044\u305f\u5909\u66f4\u3092\u4e0a\u66f8\u304d\u3066\u3057\u307e\u3046&hellip;<\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"bitbucket_subtitle":"","footnotes":""},"categories":[1],"tags":[103,170,318],"coauthors":[],"class_list":["post-2938","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-git","tag-teams","tag-workflows"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.atlassian.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/2938","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.atlassian.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.atlassian.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.atlassian.com\/ja\/blog\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/www.atlassian.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=2938"}],"version-history":[{"count":0,"href":"https:\/\/www.atlassian.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/2938\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.atlassian.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=2938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.atlassian.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=2938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.atlassian.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=2938"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.atlassian.com\/ja\/blog\/wp-json\/wp\/v2\/coauthors?post=2938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}