{"id":4466,"date":"2024-02-05T18:21:45","date_gmt":"2024-02-05T09:21:45","guid":{"rendered":"https:\/\/blog.since2020.jp\/?p=4466"},"modified":"2024-02-05T18:28:35","modified_gmt":"2024-02-05T09:28:35","slug":"git-switch-%e3%83%96%e3%83%a9%e3%83%b3%e3%83%81%e6%93%8d%e4%bd%9c%e3%82%92%e3%82%82%e3%81%a3%e3%81%a8%e3%82%b9%e3%83%9e%e3%83%bc%e3%83%88%e3%81%ab","status":"publish","type":"post","link":"https:\/\/since2020.jp\/media\/git-switch-%e3%83%96%e3%83%a9%e3%83%b3%e3%83%81%e6%93%8d%e4%bd%9c%e3%82%92%e3%82%82%e3%81%a3%e3%81%a8%e3%82%b9%e3%83%9e%e3%83%bc%e3%83%88%e3%81%ab\/","title":{"rendered":"Git Switch: \u30d6\u30e9\u30f3\u30c1\u64cd\u4f5c\u3092\u3082\u3063\u3068\u30b9\u30de\u30fc\u30c8\u306b"},"content":{"rendered":"\n<p>Git\u306e\u30d0\u30fc\u30b8\u30e7\u30f32.23.0\u3067\u5c0e\u5165\u3055\u308c\u305fgit switch\u30b3\u30de\u30f3\u30c9\u306f\u3001\u30d6\u30e9\u30f3\u30c1\u306e\u5207\u308a\u66ff\u3048\u3084\u65b0\u3057\u3044\u30d6\u30e9\u30f3\u30c1\u306e\u4f5c\u6210\u3092\u3088\u308a\u76f4\u611f\u7684\u306b\u884c\u3046\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002\u5f93\u6765\u306egit checkout\u30b3\u30de\u30f3\u30c9\u306b\u4ee3\u308f\u308b\u3082\u306e\u3067\u3001checkout\u306e\u6301\u3064\u8907\u6570\u306e\u6a5f\u80fd\u3092\u3088\u308a\u660e\u78ba\u306b\u5206\u3051\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001git switch\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3068\u4fbf\u5229\u306a\u6a5f\u80fd\u3092\u30b3\u30fc\u30c9\u4f8b\u3068\u5171\u306b\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n<h2>\u306f\u3058\u3081\u306b<\/h2>\n<p><span style=\"font-family: arial, helvetica, sans-serif\">Git\u306e\u30d0\u30fc\u30b8\u30e7\u30f32.23.0\u3067\u5c0e\u5165\u3055\u308c\u305f<span data-token-index=\"1\" class=\"notion-enable-hover\">git switch<\/span>\u30b3\u30de\u30f3\u30c9\u306f\u3001\u30d6\u30e9\u30f3\u30c1\u306e\u5207\u308a\u66ff\u3048\u3084\u65b0\u3057\u3044\u30d6\u30e9\u30f3\u30c1\u306e\u4f5c\u6210\u3092\u3088\u308a\u76f4\u611f\u7684\u306b\u884c\u3046\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002\u5f93\u6765\u306e<span data-token-index=\"3\" class=\"notion-enable-hover\">git checkout<\/span>\u30b3\u30de\u30f3\u30c9\u306b\u4ee3\u308f\u308b\u3082\u306e\u3067\u3001<span data-token-index=\"5\" class=\"notion-enable-hover\">checkout<\/span>\u306e\u6301\u3064\u8907\u6570\u306e\u6a5f\u80fd\u3092\u3088\u308a\u660e\u78ba\u306b\u5206\u3051\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001<span data-token-index=\"7\" class=\"notion-enable-hover\">git switch<\/span>\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3068\u4fbf\u5229\u306a\u6a5f\u80fd\u3092\u30b3\u30fc\u30c9\u4f8b\u3068\u5171\u306b\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/span><!-- notionvc: adf1f8e9-9fb3-4e90-9eea-be8a8c226c4b --><\/p>\n\n<h2>Git Switch\u306e\u57fa\u672c<\/h2>\n<b><span style=\"font-family: arial, helvetica, sans-serif\">\u30d6\u30e9\u30f3\u30c1\u306e\u5207\u308a\u66ff\u3048<\/span><\/b>\r\n<p><span style=\"font-family: arial, helvetica, sans-serif\"><code><span style=\"color: #ff0000\">git switch<\/span><\/code>\u3092\u4f7f\u3063\u3066\u65e2\u5b58\u306e\u30d6\u30e9\u30f3\u30c1\u306b\u5207\u308a\u66ff\u3048\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/span><\/p>\r\n<pre><span style=\"font-family: arial, helvetica, sans-serif\"><code class=\"language-bash\"><\/code><\/span><\/pre>\r\n<div class=\"hcb_wrap\">\r\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git switch &lt;\u30d6\u30e9\u30f3\u30c1\u540d&gt;<\/code><\/pre>\r\n<\/div>\r\n<pre><span style=\"font-family: arial, helvetica, sans-serif\"><code class=\"language-bash\"><\/code><\/span><\/pre>\r\n<p><span style=\"font-family: arial, helvetica, sans-serif\">\u4f8b\u3048\u3070\u3001<span style=\"color: #000000\"><code>feature<\/code><\/span>\u30d6\u30e9\u30f3\u30c1\u306b\u5207\u308a\u66ff\u3048\u305f\u3044\u5834\u5408\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u5165\u529b\u3057\u307e\u3059\u3002<\/span><\/p>\r\n<pre><span style=\"font-family: arial, helvetica, sans-serif\"><code class=\"language-bash\"><\/code><\/span><\/pre>\r\n<div class=\"hcb_wrap\">\r\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git switch feature<\/code><\/pre>\r\n<\/div>\r\n<pre><span style=\"font-family: arial, helvetica, sans-serif\"><code class=\"language-bash\"><\/code><\/span><\/pre>\r\n<p><span style=\"font-family: arial, helvetica, sans-serif\">\u3053\u308c\u306f<code>git checkout feature<\/code><strong>\u3068\u540c\u3058\u52d5\u4f5c\u3092\u3057\u307e\u3059\u304c\u3001<\/strong><code>switch<\/code>\u306f\u30d6\u30e9\u30f3\u30c1\u306e\u5207\u308a\u66ff\u3048\u5c02\u7528\u306a\u306e\u3067\u3001\u30b3\u30de\u30f3\u30c9\u306e\u610f\u56f3\u304c\u3088\u308a\u660e\u78ba\u3067\u3059\u3002<\/span><\/p>\r\n<p><!-- notionvc: 73abe8c0-5fc6-44a3-b23f-458282e4fc2c --><\/p>\n\n<h2>\u65b0\u3057\u3044\u30d6\u30e9\u30f3\u30c1\u306e\u4f5c\u6210\u3068\u5207\u308a\u66ff\u3048<\/h2>\n<p><span style=\"font-family: arial, helvetica, sans-serif\">\u65b0\u3057\u3044\u30d6\u30e9\u30f3\u30c1\u3092\u4f5c\u6210\u3057\u3066\u305d\u306e\u30d6\u30e9\u30f3\u30c1\u306b\u76f4\u63a5\u5207\u308a\u66ff\u3048\u308b\u306b\u306f\u3001<span style=\"color: #ff0000\"><code>-c<\/code><\/span>\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/span><\/p>\r\n<pre><span style=\"font-family: arial, helvetica, sans-serif\"><code class=\"language-bash\"><\/code><\/span><\/pre>\r\n<div class=\"hcb_wrap\">\r\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git switch -c &lt;\u65b0\u3057\u3044\u30d6\u30e9\u30f3\u30c1\u540d&gt;<\/code><\/pre>\r\n<\/div>\r\n<pre><span style=\"font-family: arial, helvetica, sans-serif\"><code class=\"language-bash\"><\/code><\/span><\/pre>\r\n<p><span style=\"font-family: arial, helvetica, sans-serif\">\u4f8b\u3048\u3070\u3001\u65b0\u3057\u3044<span style=\"color: #000000\"><code><span style=\"color: #000000\">feature-new<\/span><\/code><\/span>\u30d6\u30e9\u30f3\u30c1\u3092\u4f5c\u6210\u3057\u3066\u5207\u308a\u66ff\u3048\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/span><\/p>\r\n<pre><span style=\"font-family: arial, helvetica, sans-serif\"><code class=\"language-bash\"><\/code><\/span><\/pre>\r\n<div class=\"hcb_wrap\">\r\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git switch -c feature-new<\/code><\/pre>\r\n<\/div>\r\n<pre><span style=\"font-family: arial, helvetica, sans-serif\"><code class=\"language-bash\"><\/code><\/span><\/pre>\r\n<p><span style=\"font-family: arial, helvetica, sans-serif\">\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f<code>git checkout -b feature-new<\/code><strong>\u3068\u540c\u7b49\u3067\u3059\u304c\u3001\u518d\u3073\u3001<\/strong><code>switch<\/code>\u306e\u65b9\u304c\u64cd\u4f5c\u306e\u610f\u56f3\u304c\u660e\u78ba\u306b\u306a\u308a\u307e\u3059\u3002<\/span><\/p>\r\n<p><!-- notionvc: f90e3311-5636-4858-a7a1-659ce18ba5a0 --><\/p>\n\n<h2>\u4fbf\u5229\u306a\u30aa\u30d7\u30b7\u30e7\u30f3<\/h2>\n<b><span style=\"font-family: arial, helvetica, sans-serif\">\u30d6\u30e9\u30f3\u30c1\u306e\u4f5c\u6210\u5143\u3092\u6307\u5b9a<\/span><\/b>\r\n<p><span style=\"font-family: arial, helvetica, sans-serif\">\u65b0\u3057\u3044\u30d6\u30e9\u30f3\u30c1\u3092\u4f5c\u6210\u3059\u308b\u969b\u306b\u3001\u4f5c\u6210\u5143\u306e\u30d6\u30e9\u30f3\u30c1\u3092\u6307\u5b9a\u3057\u305f\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<span style=\"color: #000000\"><code><span style=\"color: #000000\">git switch<\/span><\/code><\/span><strong>\u3067\u306f\u3001<\/strong><span style=\"color: #000000\"><code>-c<\/code><\/span>\u30aa\u30d7\u30b7\u30e7\u30f3\u3068\u5171\u306b\u4f5c\u6210\u5143\u306e\u30d6\u30e9\u30f3\u30c1\u540d\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\r\n<pre><span style=\"font-family: arial, helvetica, sans-serif\"><code class=\"language-bash\"><\/code><\/span><\/pre>\r\n<div class=\"hcb_wrap\">\r\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git switch -c &lt;\u65b0\u3057\u3044\u30d6\u30e9\u30f3\u30c1\u540d&gt; &lt;\u4f5c\u6210\u5143\u306e\u30d6\u30e9\u30f3\u30c1\u540d&gt;<\/code><\/pre>\r\n<\/div>\r\n<pre><span style=\"font-family: arial, helvetica, sans-serif\"><code class=\"language-bash\"><\/code><\/span><\/pre>\r\n<p><span style=\"font-family: arial, helvetica, sans-serif\">\u4f8b\u3048\u3070\u3001<code>develop<\/code><strong>\u30d6\u30e9\u30f3\u30c1\u304b\u3089\u65b0\u3057\u3044<\/strong><code>feature-from-develop<\/code>\u30d6\u30e9\u30f3\u30c1\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/span><\/p>\r\n<div class=\"hcb_wrap\">\r\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git switch -c feature-from-develop develop<\/code><\/pre>\r\n<\/div>\r\n<p><br \/>\r\n<!-- notionvc: 216d3200-96c2-4bb3-9602-abcbf7b6493b --><\/p>\r\n<p><!-- notionvc: 1bcc2d6d-cbdf-4cac-9f81-9540633acf2d --><\/p>\n\n<h2>\u5fa9\u5143\u30aa\u30d7\u30b7\u30e7\u30f3<\/h2>\n<p><span style=\"font-family: arial, helvetica, sans-serif\">\u4f5c\u696d\u4e2d\u306b\u4f55\u3089\u304b\u306e\u7406\u7531\u3067\u6700\u5f8c\u306e\u30b3\u30df\u30c3\u30c8\u306b\u623b\u3057\u305f\u3044\u5834\u5408\u3001<span style=\"color: #ff0000\"><code><span style=\"color: #ff0000\">--discard-changes<\/span><\/code><\/span>\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u3066\u672a\u30b3\u30df\u30c3\u30c8\u306e\u5909\u66f4\u3092\u7834\u68c4\u3057\u3001\u6700\u5f8c\u306e\u30b3\u30df\u30c3\u30c8\u72b6\u614b\u306b\u623b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\r\n<pre><span style=\"font-family: arial, helvetica, sans-serif\"><code class=\"language-bash\"><\/code><\/span><\/pre>\r\n<div class=\"hcb_wrap\">\r\n<pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git switch --discard-changes &lt;\u30d6\u30e9\u30f3\u30c1\u540d&gt;\r\n<\/code><\/pre>\r\n<\/div>\r\n<pre><span style=\"font-family: arial, helvetica, sans-serif\"><code class=\"language-bash\"><\/code><\/span><\/pre>\r\n<p><span style=\"font-family: arial, helvetica, sans-serif\">\u3053\u306e\u64cd\u4f5c\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002\u672a\u30b3\u30df\u30c3\u30c8\u306e\u5909\u66f4\u3092\u5931\u3046\u53ef\u80fd\u6027\u304c\u3042\u308b\u305f\u3081\u3001\u4f7f\u7528\u3059\u308b\u524d\u306b\u306f\u5fc5\u305a\u5909\u66f4\u3092\u30b3\u30df\u30c3\u30c8\u3059\u308b\u304b\u3001\u5225\u306e\u65b9\u6cd5\u3067\u4fdd\u5b58\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/span><\/p>\r\n<p><!-- notionvc: 0f394fc3-3fbb-4fce-8edb-a62da40b400f --><\/p>\n\n<h2>\u307e\u3068\u3081<\/h2>\n<p><span style=\"font-family: arial, helvetica, sans-serif\"><span data-token-index=\"0\" class=\"notion-enable-hover\">git switch<\/span>\u30b3\u30de\u30f3\u30c9\u306f\u3001\u30d6\u30e9\u30f3\u30c1\u64cd\u4f5c\u3092\u3088\u308a\u76f4\u611f\u7684\u304b\u3064\u660e\u78ba\u306b\u884c\u3046\u305f\u3081\u306e\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002<span data-token-index=\"2\" class=\"notion-enable-hover\">checkout<\/span>\u30b3\u30de\u30f3\u30c9\u306b\u6bd4\u3079\u3066\u3001\u4f55\u3092\u3057\u3066\u3044\u308b\u304b\u304c\u660e\u78ba\u306b\u306a\u308a\u3001Git\u306e\u4f5c\u696d\u30d5\u30ed\u30fc\u3092\u30b9\u30e0\u30fc\u30ba\u306b\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u7d39\u4ecb\u3057\u305f\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3068\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6d3b\u7528\u3057\u3066\u3001\u3042\u306a\u305f\u306eGit\u64cd\u4f5c\u3092\u3088\u308a\u52b9\u7387\u7684\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/span><!-- notionvc: 563f9518-12f3-412b-b973-d7d6e7434830 --><\/p>","protected":false},"excerpt":{"rendered":"<p>Git\u306e\u30d0\u30fc\u30b8\u30e7\u30f32.23.0\u3067\u5c0e\u5165\u3055\u308c\u305fgit switch\u30b3\u30de\u30f3\u30c9\u306f\u3001\u30d6\u30e9\u30f3\u30c1\u306e\u5207\u308a\u66ff\u3048\u3084\u65b0\u3057\u3044\u30d6\u30e9\u30f3\u30c1\u306e\u4f5c\u6210\u3092\u3088\u308a\u76f4\u611f\u7684\u306b\u884c\u3046\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002\u5f93\u6765\u306egit checkout\u30b3\u30de\u30f3\u30c9\u306b\u4ee3\u308f\u308b\u3082\u306e\u3067\u3001checkout\u306e [&hellip;]<\/p>\n","protected":false},"author":87,"featured_media":4311,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","swell_btn_cv_data":"","footnotes":"","_wp_rev_ctl_limit":""},"categories":[1249],"tags":[265,268,550],"class_list":["post-4466","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledge","tag-git","tag-github","tag-switch"],"_links":{"self":[{"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/posts\/4466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/users\/87"}],"replies":[{"embeddable":true,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/comments?post=4466"}],"version-history":[{"count":0,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/posts\/4466\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/media\/4311"}],"wp:attachment":[{"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/media?parent=4466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/categories?post=4466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/tags?post=4466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}