<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Branches > 原文:[https://docs.gitlab.com/ee/user/project/repository/branches/](https://docs.gitlab.com/ee/user/project/repository/branches/) * [Default branch](#default-branch) * [Custom initial branch name](#custom-initial-branch-name-core-only) * [Enable or disable custom initial branch name](#enable-or-disable-custom-initial-branch-name-core-only) * [Compare](#compare) * [Delete merged branches](#delete-merged-branches) * [Branch filter search box](#branch-filter-search-box) # Branches[](#branches "Permalink") 分支是項目工作樹的版本. 您為所做的每組相關更改創建一個分支. 這樣可以使每組更改彼此獨立,從而可以并行進行更改,而不會互相影響. 將更改推送到新分支后,您可以: * 創建[合并請求](../../merge_requests/index.html) * 執行內聯代碼審查 * 與團隊[討論](../../../discussions/index.html)實施情況 * 使用[Review Apps](../../../../ci/review_apps/index.html)預覽提交到新分支的更改. 使用[GitLab Starter](https://about.gitlab.com/pricing/) ,您還可以請求經理的[批準](../../merge_requests/merge_request_approvals.html) . 有關使用 GitLab UI 管理分支的更多信息,請參見: * [Default branches](#default-branch) * [Create a branch](../web_editor.html#create-a-new-branch) * [Protected branches](../../protected_branches.html#protected-branches) * [Delete merged branches](#delete-merged-branches) * [Branch filter search box](#branch-filter-search-box) 您也可以使用[命令行](../../../../gitlab-basics/start-using-git.html#create-a-branch)管理分支. 觀看視頻[GitLab Flow](https://www.youtube.com/watch?v=InKNIvky2KE) . 也可以看看: * [Branches API](../../../../api/branches.html) ,有關使用 GitLab API 在存儲庫分支上進行操作的信息. * [GitLab Flow](../../../../university/training/gitlab_flow.html) documentation. * [Git](../../../../topics/git/index.html)和 GitLab [入門](../../../../topics/git/index.html) . ## Default branch[](#default-branch "Permalink") 創建新[項目時](../../index.html) ,GitLab 會將`master`設置為存儲庫的默認分支. 您可以在項目的**設置>存儲庫**下選擇另一個分支作為項目的默認分支. 通過[問題關閉模式](../../issues/managing_issues.html#closing-issues-automatically)直接從合并請求中[關閉問題時](../../issues/managing_issues.html#closing-issues-automatically) ,目標是項目的**默認分支** . 初始還對默認分支進行了[保護,以](../../protected_branches.html#protected-branches)防止意外刪除和強制推送. ### Custom initial branch name[](#custom-initial-branch-name-core-only "Permalink") 版本歷史 * 在 GitLab 13.2 中[引入](https://gitlab.com/gitlab-org/gitlab/-/issues/221013) . * 它部署在默認情況下啟用的功能標志后面. * 在 GitLab.com 上啟用了它. * 不能根據項目啟用或禁用它. * 建議用于生產. * 對于 GitLab 自我管理的實例,GitLab 管理員可以選擇[禁用它](#enable-or-disable-custom-initial-branch-name-core-only) . 默認情況下,當您在 GitLab 中創建新項目時,初始分支稱為`master` . 對于自我管理的實例,GitLab 管理員可以將初始分支名稱自定義為其他名稱. 這樣,此后創建的每個新項目都將從自定義分支名稱開始,而不是`master` . 為此: 1. 轉到 **在管理區域>設置>存儲庫中** ,展開**默認初始分支名稱** . 2. 將默認的初始分支更改為您選擇的自定義名稱. 3. **保存更改**. #### Enable or disable custom initial branch name[](#enable-or-disable-custom-initial-branch-name-core-only "Permalink") 正在設置默認的初始分支名稱,但已準備好用于生產. 它部署在**默認情況下啟用**的功能標志的后面. [有權訪問 GitLab Rails 控制臺的 GitLab 管理員](../../../../administration/feature_flags.html)可以選擇為您的實例禁用它. 禁用它: ``` Feature.disable(:global_default_branch_name) ``` 要啟用它: ``` Feature.enable(:global_default_branch_name) ``` ## Compare[](#compare "Permalink") 要比較存儲庫中的分支: 1. 導航到項目的存儲庫. 2. 在邊欄中選擇**存儲庫>比較** . 3. 使用[分支過濾器搜索框](#branch-filter-search-box)選擇要比較的[分支](#branch-filter-search-box) 4. 單擊" **比較** "以內聯查看更改: [![compare branches](https://img.kancloud.cn/56/af/56afed3ae5d2361625dfd1591d51d0ce_3132x1418.png)](img/compare_branches.png) ## Delete merged branches[](#delete-merged-branches "Permalink") 在 GitLab 8.14 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/6449) . [![Delete merged branches](https://img.kancloud.cn/66/a6/66a6aa3f829a64454ff26cfbe3e8ec6f_1517x293.png)](img/delete_merged_branches.png) 此功能允許合并的分支被批量刪除. 作為此操作的一部分,只有已合并[但未受保護的](../../protected_branches.html)分支才會被刪除. 清理合并請求時未自動刪除的舊分支尤其有用. ## Branch filter search box[](#branch-filter-search-box "Permalink") 在 GitLab 11.5 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/22166) . [![Branch filter search box](https://img.kancloud.cn/e7/9c/e79c7616b7fa32f29fd4209052672c6e_1035x522.png)](img/branch_filter_search_box.png) 此功能使您可以快速搜索和選擇分支. 搜索結果按以下順序顯示: * 名稱與搜索字詞完全匹配的分支. * 名稱包含搜索詞的其他分支,按字母順序排序. 有時,當您有數百個分支時,可能需要更靈活的匹配模式. 在這種情況下,您可以使用以下方法: * `^feature`將僅匹配以'feature'開頭的分支名稱. * `feature$` will only match branch names that end with ‘feature’.
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看