{"id":9521,"date":"2020-03-07T23:53:55","date_gmt":"2020-03-07T14:53:55","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=9521"},"modified":"2023-05-27T18:56:42","modified_gmt":"2023-05-27T09:56:42","slug":"%e3%80%90git%e3%80%91%e3%82%b9%e3%82%bf%e3%83%83%e3%82%b7%e3%83%a5%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=9521","title":{"rendered":"\u3010Git\u3011\u30b9\u30bf\u30c3\u30b7\u30e5\u306b\u3064\u3044\u3066"},"content":{"rendered":"<h2 class=\"p1\">\u30b9\u30bf\u30c3\u30b7\u30e5\u3068\u306f\uff1f<\/h2>\n<p class=\"p1\">\u4f5c\u696d\u4e2d\u306e\u5909\u66f4\u5185\u5bb9\u3092\u5225\u306e\u5834\u6240\u306b\u4e00\u6642\u7684\u306b\u9000\u907f\u3055\u305b\u3066\u304a\u304f\u3053\u3068\u3067\u3059\u3002\u4f5c\u696d\u4e2d\u3060\u3051\u3069\u5225\u306b\u3084\u308a\u305f\u3044\u3053\u3068\u304c\u3067\u304d\u305f\u3068\u304b\u3067\u4eca\u306f\u30b3\u30df\u30c3\u30c8\u3057\u305f\u304f\u306a\u3044\u3068\u8a00\u3046\u6642\u306b\u4f7f\u3048\u307e\u3059\u3002(\u4e3b\u306a\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3068\u3057\u3066\u306fPR\u30ec\u30d3\u30e5\u30fc\u3068\u304b\u304c\u767a\u751f\u3057\u3066\u5225\u30d6\u30e9\u30f3\u30c1\u3092\u30ed\u30fc\u30ab\u30eb\u306b\u53d6\u308a\u8fbc\u307f\u305f\u3044\u6642\u306a\u3069\u304c\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u3082\u3057\u304f\u306f\u7dca\u6025\u306e\u969c\u5bb3\u5bfe\u5fdc\u306a\u3069\u3002\uff09<\/p>\n<h2 class=\"p1\">\u4ed5\u7d44\u307f<\/h2>\n<p class=\"p1\">\u30b9\u30bf\u30c3\u30b7\u30e5\u3068\u3044\u3046\u5834\u6240\u306b\u4e00\u6642\u7684\u306b\u683c\u7d0d\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<h2 class=\"p1\">\u30b3\u30de\u30f3\u30c9<\/h2>\n<h3 class=\"p1\">\u4f5c\u696d\u3092\u907f\u96e3\u3055\u305b\u308b\u3002<\/h3>\n<pre class=\"lang:default decode:true\">git stash -u<\/pre>\n<p>\u5b9f\u884c\u3059\u308b\u3068\u300c\u30ef\u30fc\u30ad\u30f3\u30b0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u300d\u4e0a\u306f\u5dee\u5206\u304c\u306a\u3044\u72b6\u614b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h4>-u<\/h4>\n<p>\u300c--include-untracked\u300d\u306e\u7565\u3067\u3059\u3002\u65b0\u898f\u4f5c\u6210\u30d5\u30a1\u30a4\u30eb\u3082\u9000\u907f\u3055\u305b\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h3>\u540d\u524d\u3092\u3064\u3051\u3066\u9000\u907f\u3059\u308b\u3002<\/h3>\n<pre class=\"lang:default decode:true \">git stash save \"\u4efb\u610f\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\" -u<\/pre>\n<p>\u4f55\u3082\u540d\u524d\u3092\u6307\u5b9a\u3057\u306a\u3044\u3068\u300cstash@{\u6570\u5b57}\u300d\u306e\u3088\u3046\u306a\u540d\u524d\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u3067\u975e\u5e38\u306b\u308f\u304b\u308a\u3065\u3089\u3044\u3067\u3059\u3002\u4e0a\u8a18\u306e\u3088\u3046\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u6307\u5b9a\u3059\u308b\u3068\u300cgit stash list\u300d\u3092\u3057\u305f\u3068\u304d\u306e\u305d\u306e\u540d\u524d\u3067\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u5f8c\u3067\u898b\u305f\u3068\u304d\u306b\u308f\u304b\u308a\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3 class=\"p1\">\u907f\u96e3\u3057\u305f\u4f5c\u696d\u306e\u4e00\u89a7\u3092\u8868\u793a\u3059\u308b\u3002<\/h3>\n<p class=\"p1\">\u8907\u6570\u56de\u907f\u96e3\u3055\u305b\u305f\u5834\u5408\u3067\u3082\u8907\u6570\u884c\u306b\u6e21\u3063\u3066\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">Git stash list<\/pre>\n<h3 class=\"p1\">\u907f\u96e3\u3057\u305f\u60c5\u5831\u3092\u5fa9\u5143\u3059\u308b\u3002<\/h3>\n<pre class=\"lang:default decode:true\">git stash apply [\u30b9\u30bf\u30c3\u30b7\u30e5\u540d] \r\ngit stash apply stash@{\u6570\u5b57}<\/pre>\n<p>\u300cgit stash list\u300d\u3067\u78ba\u8a8d\u3057\u305fstash\u306e\u756a\u53f7\u3092\u6307\u5b9a\u3057\u3066\u4f5c\u696d\u3092\u623b\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f5c\u696d\u3057\u3066\u3044\u305f\u30d6\u30e9\u30f3\u30c1\u3058\u3083\u306a\u304f\u3066\u3082\u73fe\u5728\u4f5c\u696d\u3057\u3066\u3044\u308b\u30d6\u30e9\u30f3\u30c1\u306b\u5909\u66f4\u5206\u304c\u9069\u5fdc\u3055\u308c\u307e\u3059\u3002<\/p>\n<p class=\"p3\">\u306a\u304a\u3001\u6570\u5b57\u306b\u95a2\u3057\u3066\u306f\u6700\u65b0\u306e\u907f\u96e3\u4f5c\u696d\u304c<span class=\"s1\">0<\/span>\u3067\u65b0\u3057\u3044\u9806\u306b\u756a\u53f7\u304c<span class=\"s1\">1<\/span>\u3001<span class=\"s1\">2<\/span>\u3068\u63a1\u756a\u3055\u308c\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h3 class=\"p1\">\u30b9\u30c6\u30fc\u30b8\u306e\u72b6\u6cc1\u3082\u542b\u3081\u3066\u5fa9\u5143\u3059\u308b<\/h3>\n<pre class=\"lang:default decode:true\">git stash apply \u2014index stash@<span class=\"o\">{<\/span>0<span class=\"o\">}<\/span><\/pre>\n<p>\u300cGit stash apply stash@<span class=\"o\">{<\/span>0<span class=\"o\">}\u300d\u3060\u3068git add\u3057\u305f\u72b6\u614b\u306f\u5fa9\u5143\u3067\u304d\u307e\u305b\u3093\u3002--index\u3092\u3064\u3051\u308b\u3053\u3068\u3067add\u3057\u305f\u72b6\u614b\u3082\u5fa9\u5143\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/span><\/p>\n<h3>\u5dee\u5206\u3092\u8868\u793a<\/h3>\n<pre class=\"lang:default decode:true \">git diff stash@{0}<\/pre>\n<p>\u6307\u5b9a\u3057\u305fstash\u306e\u5dee\u5206\u3092\u95b2\u89a7\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u5f8c\u3067\u306a\u3093\u306e\u4f5c\u696d\u306a\u306e\u304b\u308f\u304b\u3089\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u5834\u5408\u306f\u4f7f\u3048\u305d\u3046\u3067\u3059\u306d\u3002<\/p>\n<h3>\u907f\u96e3\u3057\u305f\u4f5c\u696d\u3092\u524a\u9664\u3059\u308b\u3002<\/h3>\n<h3>\u6700\u65b0\u4f5c\u696d\u3092\u524a\u9664<\/h3>\n<pre class=\"lang:default decode:true \">git stash drop<\/pre>\n<h3>\u7279\u5b9a\u4f5c\u696d\u3092\u524a\u9664<\/h3>\n<pre class=\"lang:default decode:true \">git stash drop [\u30b9\u30bf\u30c3\u30b7\u30e5\u540d]\r\ngit stash drop stash@{\u6570\u5b57}<\/pre>\n<p>git\u00a0 stash apply\u3067\u9069\u5fdc\u3057\u305f\u3068\u3057\u3066\u3082\u4f5c\u696d\u5c65\u6b74\u306f\u6b8b\u3063\u305f\u307e\u307e\u306b\u306a\u308a\u307e\u3059\u3002\u898b\u3065\u3089\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u306e\u3067\u9069\u5b9c\u4e0a\u8a18\u30b3\u30de\u30f3\u30c9\u3067\u6d88\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>\u5168\u4f5c\u696d\u3092\u524a\u9664<\/h3>\n<pre class=\"lang:default decode:true  \">git stash clear<\/pre>\n","protected":false},"excerpt":{"rendered":"\u30b9\u30bf\u30c3\u30b7\u30e5\u3068\u306f\uff1f \u4f5c\u696d\u4e2d\u306e\u5909\u66f4\u5185\u5bb9\u3092\u5225\u306e\u5834\u6240\u306b\u4e00\u6642\u7684\u306b\u9000\u907f\u3055\u305b\u3066\u304a\u304f\u3053\u3068\u3067\u3059\u3002\u4f5c\u696d\u4e2d\u3060\u3051\u3069\u5225\u306b\u3084\u308a\u305f\u3044\u3053\u3068\u304c\u3067\u304d\u305f\u3068\u304b\u3067\u4eca\u306f\u30b3\u30df\u30c3\u30c8\u3057\u305f\u304f\u306a\u3044\u3068\u8a00\u3046\u6642\u306b\u4f7f\u3048\u307e\u3059\u3002(\u4e3b\u306a\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3068\u3057\u3066\u306fPR\u30ec\u30d3\u30e5\u30fc\u3068\u304b\u304c\u767a\u751f\u3057\u3066\u5225\u30d6\u30e9 [&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\/9521"}],"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=9521"}],"version-history":[{"count":6,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/9521\/revisions"}],"predecessor-version":[{"id":20185,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/9521\/revisions\/20185"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9521"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}