{"id":36227,"date":"2025-05-08T11:45:38","date_gmt":"2025-05-08T03:45:38","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/36227.html"},"modified":"2025-05-08T11:45:38","modified_gmt":"2025-05-08T03:45:38","slug":"gitlab%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%87%8d%e7%bd%ae%e5%af%86%e7%a0%81","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/36227.html","title":{"rendered":"Gitlab\u670d\u52a1\u5668\u91cd\u7f6e\u5bc6\u7801"},"content":{"rendered":"<p style=\"margin-left:0;margin-right:0;text-align:justify\">\u516c\u53f8\u7684Gitlab\u670d\u52a1\u5668\u7528\u7684\u65f6\u95f4\u4e0d\u77ed\u4e86&#xff0c;\u9700\u8981\u66f4\u65b0&#xff0c;\u4f46root\u8d26\u53f7\u957f\u4e45\u672a\u767b\u5f55&#xff0c;\u6587\u6863\u4e2d\u8bb0\u5f55\u7684\u5bc6\u7801\u767b\u4e0d\u4e0a&#xff0c;\u53ea\u80fd\u91cd\u7f6e\u5bc6\u7801\u4e86\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\u8fd9\u4e2agitlab\u662fdocker\u65b9\u5f0f\u90e8\u7f72<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\u4e00\u3001\u8fdb\u5165GitLab\u5bb9\u5668<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u5165\u5bb9\u5668<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">docker exec -it gitlab \u00a0\/bin\/bash<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\u4e8c\u3001\u542f\u52a8GitLab Rails\u63a7\u5236\u53f0<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\u5728\u5bb9\u5668\u5185\u6267\u884c\u547d\u4ee4\u8fdb\u5165\u751f\u4ea7\u73af\u5883\u7684Rails\u63a7\u5236\u53f0&#xff1a;<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">gitlab-rails console -e production<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\u4e09\u3001\u91cd\u7f6eroot\u5bc6\u7801<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\u67e5\u627eroot\u7528\u6237<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5b9a\u4f4d\u7528\u6237&#xff1a;<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">user &#061; User.find_by(username: &#039;root&#039;)\u00a0<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\u8bbe\u7f6e\u65b0\u5bc6\u7801<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u4fee\u6539\u5bc6\u7801<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">user.password &#061; &#039;new_password&#039;<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">user.password_confirmation &#061; &#039;new_password&#039;<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\u4fdd\u5b58\u66f4\u6539<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\u6267\u884c\u4fdd\u5b58\u64cd\u4f5c&#xff1a;<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">user.save!<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\u8fd4\u56detrue\u8868\u793a\u4fdd\u5b58\u6210\u529f<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\u56db\u3001\u9000\u51fa\u5e76\u9a8c\u8bc1<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\u8f93\u5165exit\u9000\u51faRails\u63a7\u5236\u53f0&#xff0c;\u518d\u8f93\u5165exit\u9000\u51fa\u5bb9\u5668\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\u8bbf\u95eeGitLab\u4e3b\u9875&#xff0c;\u4f7f\u7528\u65b0\u5bc6\u7801\u767b\u5f55root\u8d26\u6237\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\u767b\u5f55\u6210\u529f\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0;text-align:justify\">\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb592\u6b21\u3002\u516c\u53f8\u7684Gitlab\u670d\u52a1\u5668\u7528\u7684\u65f6\u95f4\u4e0d\u77ed\u4e86\uff0c\u9700\u8981\u66f4\u65b0\uff0c\u4f46root\u8d26\u53f7\u957f\u4e45\u672a\u767b\u5f55\uff0c\u6587\u6863\u4e2d\u8bb0\u5f55\u7684\u5bc6\u7801\u767b\u4e0d\u4e0a\uff0c\u53ea\u80fd\u91cd\u7f6e\u5bc6\u7801\u4e86\u3002\u8f93\u5165exit\u9000\u51faRails\u63a7\u5236\u53f0\uff0c\u518d\u8f93\u5165exit\u9000\u51fa\u5bb9\u5668\u3002\u8bbf\u95eeGitLab\u4e3b\u9875\uff0c\u4f7f\u7528\u65b0\u5bc6\u7801\u767b\u5f55root\u8d26\u6237\u3002\u8fd9\u4e2agitlab\u662fdocker\u65b9\u5f0f\u90e8\u7f72\u3002\u4e8c\u3001\u542f\u52a8GitLab Rails\u63a7\u5236\u53f0\u3002\u4e00\u3001\u8fdb\u5165GitLab\u5bb9\u5668\u3002\u8fd4\u56detrue\u8868\u793a\u4fdd\u5b58\u6210\u529f\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u5165\u5bb9\u5668\u3002\u4e09\u3001\u91cd\u7f6eroot\u5bc6\u7801\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u4fee\u6539\u5bc6\u7801\u3002_gitlab\u4fee\u6539\u5bc6\u7801<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[273,43,44],"topic":[],"class_list":["post-36227","post","type-post","status-publish","format-standard","hentry","category-server","tag-gitlab","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Gitlab\u670d\u52a1\u5668\u91cd\u7f6e\u5bc6\u7801 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/36227.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Gitlab\u670d\u52a1\u5668\u91cd\u7f6e\u5bc6\u7801 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb592\u6b21\u3002\u516c\u53f8\u7684Gitlab\u670d\u52a1\u5668\u7528\u7684\u65f6\u95f4\u4e0d\u77ed\u4e86\uff0c\u9700\u8981\u66f4\u65b0\uff0c\u4f46root\u8d26\u53f7\u957f\u4e45\u672a\u767b\u5f55\uff0c\u6587\u6863\u4e2d\u8bb0\u5f55\u7684\u5bc6\u7801\u767b\u4e0d\u4e0a\uff0c\u53ea\u80fd\u91cd\u7f6e\u5bc6\u7801\u4e86\u3002\u8f93\u5165exit\u9000\u51faRails\u63a7\u5236\u53f0\uff0c\u518d\u8f93\u5165exit\u9000\u51fa\u5bb9\u5668\u3002\u8bbf\u95eeGitLab\u4e3b\u9875\uff0c\u4f7f\u7528\u65b0\u5bc6\u7801\u767b\u5f55root\u8d26\u6237\u3002\u8fd9\u4e2agitlab\u662fdocker\u65b9\u5f0f\u90e8\u7f72\u3002\u4e8c\u3001\u542f\u52a8GitLab Rails\u63a7\u5236\u53f0\u3002\u4e00\u3001\u8fdb\u5165GitLab\u5bb9\u5668\u3002\u8fd4\u56detrue\u8868\u793a\u4fdd\u5b58\u6210\u529f\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u5165\u5bb9\u5668\u3002\u4e09\u3001\u91cd\u7f6eroot\u5bc6\u7801\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u4fee\u6539\u5bc6\u7801\u3002_gitlab\u4fee\u6539\u5bc6\u7801\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/36227.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-08T03:45:38+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/36227.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/36227.html\",\"name\":\"Gitlab\u670d\u52a1\u5668\u91cd\u7f6e\u5bc6\u7801 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-08T03:45:38+00:00\",\"dateModified\":\"2025-05-08T03:45:38+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/36227.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/36227.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/36227.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Gitlab\u670d\u52a1\u5668\u91cd\u7f6e\u5bc6\u7801\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Gitlab\u670d\u52a1\u5668\u91cd\u7f6e\u5bc6\u7801 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/36227.html","og_locale":"zh_CN","og_type":"article","og_title":"Gitlab\u670d\u52a1\u5668\u91cd\u7f6e\u5bc6\u7801 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb592\u6b21\u3002\u516c\u53f8\u7684Gitlab\u670d\u52a1\u5668\u7528\u7684\u65f6\u95f4\u4e0d\u77ed\u4e86\uff0c\u9700\u8981\u66f4\u65b0\uff0c\u4f46root\u8d26\u53f7\u957f\u4e45\u672a\u767b\u5f55\uff0c\u6587\u6863\u4e2d\u8bb0\u5f55\u7684\u5bc6\u7801\u767b\u4e0d\u4e0a\uff0c\u53ea\u80fd\u91cd\u7f6e\u5bc6\u7801\u4e86\u3002\u8f93\u5165exit\u9000\u51faRails\u63a7\u5236\u53f0\uff0c\u518d\u8f93\u5165exit\u9000\u51fa\u5bb9\u5668\u3002\u8bbf\u95eeGitLab\u4e3b\u9875\uff0c\u4f7f\u7528\u65b0\u5bc6\u7801\u767b\u5f55root\u8d26\u6237\u3002\u8fd9\u4e2agitlab\u662fdocker\u65b9\u5f0f\u90e8\u7f72\u3002\u4e8c\u3001\u542f\u52a8GitLab Rails\u63a7\u5236\u53f0\u3002\u4e00\u3001\u8fdb\u5165GitLab\u5bb9\u5668\u3002\u8fd4\u56detrue\u8868\u793a\u4fdd\u5b58\u6210\u529f\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u5165\u5bb9\u5668\u3002\u4e09\u3001\u91cd\u7f6eroot\u5bc6\u7801\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u4fee\u6539\u5bc6\u7801\u3002_gitlab\u4fee\u6539\u5bc6\u7801","og_url":"https:\/\/www.wsisp.com\/helps\/36227.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-08T03:45:38+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/36227.html","url":"https:\/\/www.wsisp.com\/helps\/36227.html","name":"Gitlab\u670d\u52a1\u5668\u91cd\u7f6e\u5bc6\u7801 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-08T03:45:38+00:00","dateModified":"2025-05-08T03:45:38+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/36227.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/36227.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/36227.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Gitlab\u670d\u52a1\u5668\u91cd\u7f6e\u5bc6\u7801"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/36227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=36227"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/36227\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=36227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=36227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=36227"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=36227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}