{"id":183,"date":"2024-07-16T08:00:00","date_gmt":"2024-07-15T23:00:00","guid":{"rendered":"https:\/\/miginihitsuji.com\/prog\/?p=183"},"modified":"2026-01-17T13:09:17","modified_gmt":"2026-01-17T04:09:17","slug":"%e6%9c%ac%e7%95%aa%e7%92%b0%e5%a2%83%e3%81%a7git-pull%e3%81%97%e3%81%9f%e3%82%89%e3%82%a8%e3%83%a9%e3%83%bc%e3%81%8c%e3%81%a7%e3%81%9ferror-your-local-changes-to-the-following-files-would-be-overwri","status":"publish","type":"post","link":"https:\/\/miginihitsuji.com\/prog\/%e6%9c%ac%e7%95%aa%e7%92%b0%e5%a2%83%e3%81%a7git-pull%e3%81%97%e3%81%9f%e3%82%89%e3%82%a8%e3%83%a9%e3%83%bc%e3%81%8c%e3%81%a7%e3%81%9ferror-your-local-changes-to-the-following-files-would-be-overwri\/","title":{"rendered":"\u672c\u756a\u74b0\u5883\u3067git pull\u3057\u305f\u3089\u30a8\u30e9\u30fc\u304c\u3067\u305f(error: Your local changes to the following files would be overwritten by merge: *** Please, commit your changes or stash them before you can merge.)"},"content":{"rendered":"\n<p>\u672c\u756a\u74b0\u5883\u3067git pull\u3092\u884c\u3063\u305f\u3068\u304d\u306b\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>error: Your local changes to the following files would be overwritten by merge:\n\tcomposer.json\n\tcomposer.lock\nPlease, commit your changes or stash them before you can merge.\nAborting<\/code><\/pre><\/div>\n\n\n\n<p>\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u304c\u8d77\u304d\u305f\u3088\u3046\u3059\u3002\u30de\u30fc\u30b8\u3059\u308b\u524d\u306b\u30b3\u30df\u30c3\u30c8\u3059\u308b\u304b\u30b9\u30bf\u30c3\u30b7\u30e5\u3057\u3066\u304f\u3060\u3055\u3044\u3068\u306e\u3053\u3068\u3002<\/p>\n\n\n\n<p>\u305d\u3046\u3060\u3001Composer\u3067\u7ba1\u7406\u3057\u3066\u3044\u308b\u3044\u304f\u3064\u304b\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3092\u3057\u305f\u3053\u3068\u3092\u601d\u3044\u51fa\u3057\u305f\u3002<br>\u4eca\u56de\u306f\u3001\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u7f6e\u304d\u63db\u3048\u3066\u554f\u984c\u306a\u3044\u3002<\/p>\n\n\n\n<p>\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>$ git status\n# On branch main\n# Your branch is behind &#39;origin\/main&#39; by 7 commits, and can be fast-forwarded.\n#   (use &quot;git pull&quot; to update your local branch)\n#\n# Changes not staged for commit:\n#   (use &quot;git add &lt;file&gt;...&quot; to update what will be committed)\n#   (use &quot;git checkout -- &lt;file&gt;...&quot; to discard changes in working directory)\n#\n#\tmodified:   composer.json\n#\tmodified:   composer.lock\n#\n# Untracked files:\n#   (use &quot;git add &lt;file&gt;...&quot; to include in what will be committed)\n#\n#\tpackage-lock.json\nno changes added to commit (use &quot;git add&quot; and\/or &quot;git commit -a&quot;)<\/code><\/pre><\/div>\n\n\n\n<p><span class=\"swl-bg-color has-swl-pale-01-background-color\"><span class=\"swl-inline-color has-swl-deep-01-color\">Changes not staged for commit:<\/span><\/span> \u3067\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u304c\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u306e\u30d5\u30a1\u30a4\u30eb\u3068\u540c\u3058\u3002\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u3092\u53d6\u308a\u6d88\u3057\u3066\u3082\u554f\u984c\u306a\u3044\u306e\u3067 <span class=\"swl-bg-color has-swl-pale-01-background-color\"><span class=\"swl-inline-color has-swl-deep-01-color\">git checkout<\/span><\/span> \u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>$ git checkout . \n\n# \u30d5\u30a1\u30a4\u30eb\u3092\u7279\u5b9a\u3057\u3066\u5b9f\u884c\u3059\u308b\u5834\u5408\n$ git checkout \u30d5\u30a1\u30a4\u30eb\u540d<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u308c\u3067\u3001\u3082\u3046\u4e00\u5ea6 git pull \u3057\u3066\u307f\u308b\u3068\u4e0a\u624b\u304f\u3044\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u306e\u30de\u30fc\u30b8\u304c\u5fc5\u8981\u306a\u5834\u5408\u306f\u3001git stash \u3067\u4e00\u6642\u9000\u907f\u3055\u305b\u3066\u3001\u4eca\u3059\u3050\u3084\u308a\u305f\u3044\u4f5c\u696d\u3092\u3057\u3066\u304b\u3089\u3001\u9000\u907f\u3057\u305f\u5909\u66f4\u3092\u623b\u3057\u3066\u4f5c\u696d\u3092\u518d\u958b\u3068\u3044\u3046\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code># \u4f5c\u696d\u3092\u4e00\u6642\u9000\u907f\n$ git stash\n\n# \u9000\u907f\u3057\u305f\u4f5c\u696d\u3092\u78ba\u8a8d\n$ git stash list\n\n# \u9000\u907f\u3057\u305f\u4f5c\u696d\u3092\u5fa9\u5143\n$ git stash pop  \/\/ \u6700\u65b0\u306e\u4f5c\u696d\n$ git stash pop stash@{1} \/\/ \u7279\u5b9a\u306e\u4f5c\u696d\n\n# \u9000\u907f\u3057\u305f\u4f5c\u696d\u3092\u524a\u9664\n$ git stash drop \/\/ \u6700\u65b0\u306e\u4f5c\u696d\n$ git stash drop stash@{1} \/\/ \u7279\u5b9a\u306e\u4f5c\u696d\n\n# \u9000\u907f\u3057\u305f\u4f5c\u696d\u3092\u5168\u3066\u524a\u9664\n$ git stash clear<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u756a\u74b0\u5883\u3067git pull\u3092\u884c\u3063\u305f\u3068\u304d\u306b\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u3057\u305f\u3002 \u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u304c\u8d77\u304d\u305f\u3088\u3046\u3059\u3002\u30de\u30fc\u30b8\u3059\u308b\u524d\u306b\u30b3\u30df\u30c3\u30c8\u3059\u308b\u304b\u30b9\u30bf\u30c3\u30b7\u30e5\u3057\u3066\u304f\u3060\u3055\u3044\u3068\u306e\u3053\u3068\u3002 \u305d\u3046\u3060\u3001Composer\u3067\u7ba1\u7406\u3057\u3066\u3044\u308b\u3044\u304f\u3064\u304b\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30d0\u30fc\u30b8\u30e7\u30f3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":189,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[25],"tags":[13,14],"class_list":["post-183","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hosting","tag-git","tag-github"],"_links":{"self":[{"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/posts\/183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/comments?post=183"}],"version-history":[{"count":5,"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/posts\/183\/revisions"}],"predecessor-version":[{"id":188,"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/posts\/183\/revisions\/188"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/media\/189"}],"wp:attachment":[{"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/media?parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/categories?post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/tags?post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}