{"id":7988,"date":"2025-06-12T10:43:01","date_gmt":"2025-06-12T01:43:01","guid":{"rendered":"https:\/\/code-plus.jp\/gp\/?p=7988"},"modified":"2026-06-04T00:04:52","modified_gmt":"2026-06-03T15:04:52","slug":"remove-conflicted-7988","status":"publish","type":"post","link":"https:\/\/code-plus.jp\/gp\/remove-conflicted-7988\/","title":{"rendered":"Mac\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u3001\u30b5\u30d6\u30d5\u30a9\u30eb\u30c0\u5185\u3092\u542b\u3080\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u4e00\u62ec\u30ea\u30cd\u30fc\u30e0\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u30af\u30e9\u30a6\u30c9\u30b9\u30c8\u30ec\u30fc\u30b8\u3084\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u306b\u81ea\u52d5\u7684\u306b\u8ffd\u52a0\u3055\u308c\u308b\u6587\u5b57\u5217\uff08\u4f8b\uff1a<code>[conflicted]<\/code>\u3001<code>copy<\/code>\u3001<code>(1)<\/code>\u306a\u3069\uff09\u306b\u60a9\u307e\u3055\u308c\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u7279\u306b\u591a\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u8907\u6570\u306e\u30b5\u30d6\u30d5\u30a9\u30eb\u30c0\u306b\u6563\u3089\u3070\u3063\u3066\u3044\u308b\u5834\u5408\u3001\u624b\u52d5\u3067\u306e\u30ea\u30cd\u30fc\u30e0\u306f\u975e\u5e38\u306b\u624b\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u3002<\/p>\r\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001Mac\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u4f7f\u3063\u3066\u3001\u30b5\u30d6\u30d5\u30a9\u30eb\u30c0\u3092\u542b\u3080\u8907\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u4e00\u62ec\u3067\u30ea\u30cd\u30fc\u30e0\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\r\n<h2 class=\"fz-xl\">\u89e3\u6c7a\u65b9\u6cd5\uff1a\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u7528<\/h2>\r\n<p>\u4ee5\u4e0b\u306e\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u6307\u5b9a\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306e\u3059\u3079\u3066\u306e\u30b5\u30d6\u30d5\u30a9\u30eb\u30c0\u3092\u542b\u3081\u3066\u3001\u7279\u5b9a\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u542b\u3080\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u4e00\u62ec\u3067\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\r\n<pre><code class=\"language-bash\">#!\/bin\/bash\r\n\r\nif [ -z &quot;$1&quot; ]; then\r\n    echo &quot;\u4f7f\u7528\u65b9\u6cd5: $0 \/path\/to\/directory&quot;\r\n    exit 1\r\nfi\r\n\r\n# \u6307\u5b9a\u3055\u308c\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u5b58\u5728\u3059\u308b\u304b\u78ba\u8a8d\r\nif [ ! -d &quot;$1&quot; ]; then\r\n    echo &quot;\u30a8\u30e9\u30fc: \u6307\u5b9a\u3055\u308c\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u5b58\u5728\u3057\u307e\u305b\u3093: $1&quot;\r\n    exit 1\r\nfi\r\n\r\n# \u5909\u66f4\u5bfe\u8c61\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u8868\u793a\r\necho &quot;\u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u5909\u66f4\u5bfe\u8c61\u3067\u3059:&quot;\r\nfind &quot;$1&quot; -type f -name &#39;*[conflicted]*&#39; | while IFS= read -r file; do\r\n    echo &quot;$file&quot;\r\ndone\r\n\r\n# \u78ba\u8a8d\u3092\u6c42\u3081\u308b\r\nread -p &quot;\u3053\u308c\u3089\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u304b\u3089 &#39;[conflicted]&#39; \u3092\u524a\u9664\u3057\u307e\u3059\u304b\uff1f (y\/n): &quot; confirm\r\nif [ &quot;$confirm&quot; != &quot;y&quot; ]; then\r\n    echo &quot;\u51e6\u7406\u3092\u4e2d\u6b62\u3057\u307e\u3057\u305f&quot;\r\n    exit 0\r\nfi\r\n\r\n# \u30d5\u30a1\u30a4\u30eb\u540d\u306e\u5909\u66f4\u3092\u5b9f\u884c\r\nfind &quot;$1&quot; -type f -name &#39;*[conflicted]*&#39; | while IFS= read -r file; do\r\n    newname=&quot;${file\/\/&quot; [conflicted]&quot;}&quot;\r\n    if [ &quot;$file&quot; != &quot;$newname&quot; ]; then\r\n        mv &quot;$file&quot; &quot;$newname&quot;\r\n        echo &quot;\u30ea\u30cd\u30fc\u30e0: $file -&gt; $newname&quot;\r\n    fi\r\ndone\r\n\r\necho &quot;\u51e6\u7406\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f&quot;\r\n<\/code><\/pre>\r\n<h2 class=\"fz-xl\">\u4f7f\u7528\u65b9\u6cd5<\/h2>\r\n<ol style=\"list-style-type:decimal;\">\r\n<li><p>\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u4fdd\u5b58<\/p>\r\n<ul style=\"list-style-type:bullet;\">\r\n<li>\u4e0a\u8a18\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4efb\u610f\u306e\u5834\u6240\uff08\u4f8b\uff1a<code>rename_script.sh<\/code>\uff09\u306b\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/li>\r\n<li>\u30d5\u30a1\u30a4\u30eb\u540d\u306b\u65e5\u672c\u8a9e\u3084\u30b9\u30da\u30fc\u30b9\u304c\u542b\u307e\u308c\u3066\u3044\u306a\u3044\u65b9\u304c\u5b89\u5168\u3067\u3059\u3002<\/li>\r\n<\/ul>\r\n<\/li>\r\n<li><p>\u5b9f\u884c\u6a29\u9650\u306e\u4ed8\u4e0e<\/p>\r\n<pre><code class=\"language-bash\">chmod +x &quot;\/path\/to\/rename_script.sh&quot;\r\n<\/code><\/pre>\r\n<ul style=\"list-style-type:bullet;\">\r\n<li>\u30d1\u30b9\u306b\u89d2\u62ec\u5f27\uff08<code>[]<\/code>\uff09\u3084\u30b9\u30da\u30fc\u30b9\u304c\u542b\u307e\u308c\u308b\u5834\u5408\u306f\u3001\u5fc5\u305a\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c8\uff08<code>&quot;<\/code>\uff09\u3067\u56f2\u307f\u307e\u3059\u3002<\/li>\r\n<\/ul>\r\n<\/li>\r\n<li><p>\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u884c<\/p>\r\n<pre><code class=\"language-bash\">&quot;\/path\/to\/rename_script.sh&quot; &quot;\/path\/to\/target\/directory&quot;\r\n<\/code><\/pre>\r\n<ul style=\"list-style-type:bullet;\">\r\n<li>\u5bfe\u8c61\u3068\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30d1\u30b9\u3092\u6307\u5b9a\u3057\u3066\u5b9f\u884c\u3057\u307e\u3059\u3002<\/li>\r\n<li>\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u5b9f\u884c\u524d\u306b\u5909\u66f4\u5bfe\u8c61\u306e\u30d5\u30a1\u30a4\u30eb\u4e00\u89a7\u3092\u8868\u793a\u3057\u3001\u78ba\u8a8d\u3092\u6c42\u3081\u307e\u3059\u3002<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ol>\r\n<h2 class=\"fz-xl\">\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u52d5\u4f5c\u8aac\u660e<\/h2>\r\n<ol style=\"list-style-type:decimal;\">\r\n<li><p>\u5f15\u6570\u30c1\u30a7\u30c3\u30af<\/p>\r\n<ul style=\"list-style-type:bullet;\">\r\n<li>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30d1\u30b9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d<\/li>\r\n<li>\u6307\u5b9a\u3055\u308c\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u5b58\u5728\u3059\u308b\u304b\u78ba\u8a8d<\/li>\r\n<\/ul>\r\n<\/li>\r\n<li><p>\u5bfe\u8c61\u30d5\u30a1\u30a4\u30eb\u306e\u691c\u7d22<\/p>\r\n<ul style=\"list-style-type:bullet;\">\r\n<li><code>find<\/code>\u30b3\u30de\u30f3\u30c9\u3067\u6307\u5b9a\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u691c\u7d22<\/li>\r\n<li>\u30b5\u30d6\u30d5\u30a9\u30eb\u30c0\u3082\u542b\u3081\u3066\u518d\u5e30\u7684\u306b\u691c\u7d22<\/li>\r\n<\/ul>\r\n<\/li>\r\n<li><p>\u78ba\u8a8d\u30d7\u30ed\u30f3\u30d7\u30c8<\/p>\r\n<ul style=\"list-style-type:bullet;\">\r\n<li>\u5909\u66f4\u5bfe\u8c61\u306e\u30d5\u30a1\u30a4\u30eb\u4e00\u89a7\u3092\u8868\u793a<\/li>\r\n<li>\u30e6\u30fc\u30b6\u30fc\u306b\u78ba\u8a8d\u3092\u6c42\u3081\u308b\uff08y\/n\u3067\u56de\u7b54\uff09<\/li>\r\n<\/ul>\r\n<\/li>\r\n<li><p>\u30ea\u30cd\u30fc\u30e0\u51e6\u7406<\/p>\r\n<ul style=\"list-style-type:bullet;\">\r\n<li><code>sed<\/code>\u30b3\u30de\u30f3\u30c9\u3067\u30d5\u30a1\u30a4\u30eb\u540d\u304b\u3089\u6307\u5b9a\u30d1\u30bf\u30fc\u30f3\u3092\u524a\u9664<\/li>\r\n<li><code>mv<\/code>\u30b3\u30de\u30f3\u30c9\u3067\u5b9f\u969b\u306e\u30ea\u30cd\u30fc\u30e0\u3092\u5b9f\u884c<\/li>\r\n<li>\u5404\u30d5\u30a1\u30a4\u30eb\u306e\u51e6\u7406\u7d50\u679c\u3092\u8868\u793a<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ol>\r\n<h2 class=\"fz-xl\">\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u65b9\u6cd5<\/h2>\r\n<p>\u7570\u306a\u308b\u30d1\u30bf\u30fc\u30f3\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u5909\u66f4\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e2\u7b87\u6240\u3092\u7de8\u96c6\u3057\u307e\u3059\uff1a<\/p>\r\n<ol style=\"list-style-type:decimal;\">\r\n<li><p>find\u30b3\u30de\u30f3\u30c9\u306e\u691c\u7d22\u30d1\u30bf\u30fc\u30f3<\/p>\r\n<pre><code class=\"language-bash\">find &quot;$1&quot; -type f -name &#39;*[conflicted]*&#39;\r\n<\/code><\/pre>\r\n<ul style=\"list-style-type:bullet;\">\r\n<li><code>*[conflicted]*<\/code>\u306e\u90e8\u5206\u3092\u76ee\u7684\u306e\u30d1\u30bf\u30fc\u30f3\u306b\u5909\u66f4<\/li>\r\n<\/ul>\r\n<\/li>\r\n<li><p>\u30d1\u30e9\u30e1\u30fc\u30bf\u5c55\u958b\u306e\u7f6e\u63db\u30d1\u30bf\u30fc\u30f3<\/p>\r\n<pre><code class=\"language-bash\">newname=&quot;${file\/\/&quot; [conflicted]&quot;}&quot;\r\n<\/code><\/pre>\r\n<ul style=\"list-style-type:bullet;\">\r\n<li><code>[conflicted]<\/code>\u306e\u90e8\u5206\u3092\u524a\u9664\u3057\u305f\u3044\u6587\u5b57\u5217\u306b\u5909\u66f4<\/li>\r\n<li>\u30b9\u30da\u30fc\u30b9\u3082\u542b\u3081\u3066\u524a\u9664\u3059\u308b\u5834\u5408\u306f\u3001\u30b9\u30da\u30fc\u30b9\u3082\u30d1\u30bf\u30fc\u30f3\u306b\u542b\u3081\u308b<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ol>\r\n<h2 class=\"fz-xl\">\u6ce8\u610f\u70b9<\/h2>\r\n<ul style=\"list-style-type:bullet;\">\r\n<li>\u5b9f\u884c\u524d\u306b\u5fc5\u305a\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u53d6\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059<\/li>\r\n<li>\u30d1\u30b9\u306b\u7279\u6b8a\u6587\u5b57\uff08\u30b9\u30da\u30fc\u30b9\u3001\u89d2\u62ec\u5f27\u306a\u3069\uff09\u304c\u542b\u307e\u308c\u308b\u5834\u5408\u306f\u3001\u5fc5\u305a\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c8\u3067\u56f2\u3080<\/li>\r\n<li>\u30c6\u30b9\u30c8\u7528\u306e\u5c0f\u3055\u306a\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u52d5\u4f5c\u78ba\u8a8d\u3057\u3066\u304b\u3089\u672c\u756a\u74b0\u5883\u3067\u4f7f\u7528\u3059\u308b<\/li>\r\n<li>\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u306e\u6a29\u9650\u8a2d\u5b9a\u306b\u3088\u308a\u3001\u4e00\u90e8\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u30ea\u30cd\u30fc\u30e0\u3067\u304d\u306a\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059<\/li>\r\n<\/ul>\r\n<h2 class=\"fz-xl\">\u307e\u3068\u3081<\/h2>\r\n<p>\u3053\u306e\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u591a\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u540d\u524d\u3092\u5b89\u5168\u304b\u3064\u52b9\u7387\u7684\u306b\u4e00\u62ec\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u7279\u306b\u3001\u30af\u30e9\u30a6\u30c9\u30b9\u30c8\u30ec\u30fc\u30b8\u3084\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306b\u767a\u751f\u3059\u308b\u3001\u4e0d\u8981\u306a\u6587\u5b57\u5217\u306e\u524a\u9664\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\r\n<p>\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u5b9f\u884c\u524d\u306b\u5909\u66f4\u5bfe\u8c61\u3092\u8868\u793a\u3057\u3001\u78ba\u8a8d\u3092\u6c42\u3081\u308b\u305f\u3081\u3001\u5b89\u5168\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u307e\u305f\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30d1\u30bf\u30fc\u30f3\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u3067\u3001\u69d8\u3005\u306a\u30b1\u30fc\u30b9\u306b\u5bfe\u5fdc\u3067\u304d\u307e\u3059\u3002<\/p>\r\n","protected":false},"excerpt":{"rendered":"\u30af\u30e9\u30a6\u30c9\u30b9\u30c8\u30ec\u30fc\u30b8\u3084\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u306b\u81ea\u52d5\u7684\u306b\u8ffd\u52a0\u3055\u308c\u308b\u6587\u5b57\u5217\uff08\u4f8b\uff1a[conflicted]\u3001copy\u3001(1)\u306a\u3069\uff09\u306b\u60a9\u307e\u3055\u308c\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u7279\u306b\u591a\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u8907\u6570\u306e\u30b5\u30d6\u30d5\u30a9\u30eb\u30c0\u306b\u6563[...]","protected":false},"author":1,"featured_media":9493,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","footnotes":"","vk-ltc-link":"","vk-ltc-target":"0"},"categories":[10],"tags":[209,212,211,213,186,214,191],"group":[],"class_list":["post-7988","post","type-post","status-publish","format-standard","has-post-thumbnail","category-develop-env","tag-209","tag-212","tag-211","tag-213","tag-mac","tag-214","tag-191"],"acf":[],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/7988","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/comments?post=7988"}],"version-history":[{"count":1,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/7988\/revisions"}],"predecessor-version":[{"id":12670,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/7988\/revisions\/12670"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/media\/9493"}],"wp:attachment":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/media?parent=7988"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/categories?post=7988"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/tags?post=7988"},{"taxonomy":"group","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/group?post=7988"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}