{"id":3633,"date":"2022-05-15T18:16:22","date_gmt":"2022-05-15T09:16:22","guid":{"rendered":"http:\/\/matoken.org\/blog\/?p=3633"},"modified":"2022-05-15T18:16:39","modified_gmt":"2022-05-15T09:16:39","slug":"gitlab-default-branch-switching-and-removal","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2022\/05\/15\/gitlab-default-branch-switching-and-removal\/","title":{"rendered":"GitLab\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30d6\u30e9\u30f3\u30c1\u5207\u308a\u66ff\u3048\u3068\u524a\u9664"},"content":{"rendered":"<div id=\"preamble\">\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>GitLab\u3067\u7a7a\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f5c\u6210\u3059\u308b\u3068main\u30d6\u30e9\u30f3\u30c1\u304c\u4f5c\u3089\u308c\uff0c\u30ed\u30fc\u30ab\u30eb\u306emaster\u30d6\u30e9\u30f3\u30c1\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092push\u3057\u3066\u3082\u53cd\u6620\u3055\u308c\u306a\u3044?\u3068\u6df7\u4e71\u3059\u308b\u3068\u3044\u3046\u306e\u3092\u3084\u3063\u3066\u3044\u307e\u3057\u305f\uff0e<br \/>\n\u3068\u308a\u3042\u3048\u305aGitLab\u3067\u30c7\u30d5\u30a9\u30eb\u30c8\u30d6\u30e9\u30f3\u30c1\u3092\u5909\u66f4\u3057\u3066\u7a7a\u306emain\u30d6\u30e9\u30f3\u30c1\u3092\u524a\u9664\u3057\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<p><!--more--><\/p>\n<div class=\"paragraph\">\n<p>\u30ed\u30fc\u30ab\u30eb\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u306fmaster\u3067\uff0cGitLab\u306f\u7a7a\u306emain\u3068push\u3055\u308c\u305fmaster\u304c\u3042\u308b\u72b6\u614b\u3067\u3059\uff0e<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u30d6\u30e9\u30f3\u30c1\u306fmain\u306b\u306a\u3063\u3066\u3044\u3066\u30ea\u30dd\u30b8\u30c8\u30ea\u306etop\u30da\u30fc\u30b8\u306f\u7a7a\u306e\u72b6\u614b\u3067\u3059\uff0e\u30d6\u30e9\u30f3\u30c1\u3092master\u306b\u3059\u308b\u3068master\u30d6\u30e9\u30f3\u30c1\u3092\u898b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff0e<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_\u30c7\u30d5\u30a9\u30eb\u30c8\u30d6\u30e9\u30f3\u30c1\u306e\u5207\u308a\u66ff\u3048\">\u30c7\u30d5\u30a9\u30eb\u30c8\u30d6\u30e9\u30f3\u30c1\u306e\u5207\u308a\u66ff\u3048<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u30d6\u30e9\u30f3\u30c1\u3092master\u306b\u5207\u308a\u66ff\u3048\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li>\u8a72\u5f53\u30ea\u30dd\u30b8\u30c8\u30ea\u2192\u8a2d\u5b9a\u2192\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u8a2d\u5b9a\u2192\u30c7\u30d5\u30a9\u30eb\u30c8\u30d6\u30e9\u30f3\u30c1\u2192master<\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3053\u308c\u3067\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u3067master\u30d6\u30e9\u30f3\u30c1\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_\u4e0d\u8981\u306a\u30d6\u30e9\u30f3\u30c1\u306e\u524a\u9664\">\u4e0d\u8981\u306a\u30d6\u30e9\u30f3\u30c1\u306e\u524a\u9664<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>\u6b21\u306b\u7a7a\u3067\u4f7f\u308f\u306a\u3044main\u30d6\u30e9\u30f3\u30c1\u3092\u524a\u9664\u3057\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li>\u8a72\u5f53\u30ea\u30dd\u30b8\u30c8\u30ea\u2192\u30d6\u30e9\u30f3\u30c1\u2192main\u2192&#x1f5d1;<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_gitlab\u306e\u7a7a\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u30ed\u30fc\u30ab\u30eb\u3067master\u306b\u5909\u66f4\">GitLab\u306e\u7a7a\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u30ed\u30fc\u30ab\u30eb\u3067master\u306b\u5909\u66f4<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>GitLab\u3067\u7a7a\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u30ed\u30fc\u30ab\u30eb\u306bclone\u3057\u3066\u30d6\u30e9\u30f3\u30c1\u3092master\u306b\u5909\u66f4\u3057\u3066push\u3059\u308b\u3053\u3068\u3067GitLab\u306e\u64cd\u4f5c\u3092\u5fc5\u8981\u3068\u305b\u305a\u30d6\u30e9\u30f3\u30c1\u5207\u308a\u66ff\u3048\u304c\u53ef\u80fd\u3067\u3057\u305f\uff0e\u65b0\u898f\u306e\u5834\u5408\u306f\u3053\u308c\u306e\u307b\u3046\u304c\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ git clone git@gitlab.com:matoken\/blogtest.git\n$ cd blogtest\n$ git status\nOn branch main\n\nNo commits yet\n\nnothing to commit (create\/copy files and use \"git add\" to track)\n$ git switch -c master\nSwitched to a new branch 'master'\n$ echo \"GitLab branch test.\" &gt; README.txt\n$ git add README.txt\n$ git commit -m 'add README.txt'\n[master (root-commit) 6437831] add README.txt\n 1 file changed, 1 insertion(+)\n create mode 100644 README.txt\n$ git push -u origin master\nEnumerating objects: 3, done.\nCounting objects: 100% (3\/3), done.\nWriting objects: 100% (3\/3), 898 bytes | 898.00 KiB\/s, done.\nTotal 3 (delta 0), reused 0 (delta 0), pack-reused 0\nTo gitlab.com:matoken\/blogtest.git\n * [new branch]      master -&gt; master\nbranch 'master' set up to track 'origin\/master'.<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>GitLab\u3067\u7a7a\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f5c\u6210\u3059\u308b\u3068main\u30d6\u30e9\u30f3\u30c1\u304c\u4f5c\u3089\u308c\uff0c\u30ed\u30fc\u30ab\u30eb\u306emaster\u30d6\u30e9\u30f3\u30c1\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092push\u3057\u3066\u3082\u53cd\u6620\u3055\u308c\u306a\u3044?\u3068\u6df7\u4e71\u3059\u308b\u3068\u3044\u3046\u306e\u3092\u3084\u3063\u3066\u3044\u307e\u3057\u305f\uff0e \u3068\u308a\u3042\u3048\u305aGitLab\u3067\u30c7\u30d5\u30a9\u30eb\u30c8\u30d6\u30e9\u30f3\u30c1\u3092 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[1],"tags":[586,721],"class_list":["post-3633","post","type-post","status-publish","format-standard","hentry","category-1","tag-git","tag-gitlab"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/3633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=3633"}],"version-history":[{"count":0,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/3633\/revisions"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=3633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=3633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=3633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}