<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # Push Options > 原文:[https://docs.gitlab.com/ee/user/project/push_options.html](https://docs.gitlab.com/ee/user/project/push_options.html) * [Push options for GitLab CI/CD](#push-options-for-gitlab-cicd) * [Push options for merge requests](#push-options-for-merge-requests) * [Useful Git aliases](#useful-git-aliases) * [Merge when pipeline succeeds alias](#merge-when-pipeline-succeeds-alias) # Push Options[](#push-options "Permalink") 在 GitLab 11.7 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/15643) . GitLab 支持使用客戶端[Git 推送選項](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt)在推送更改的同時執行各種操作. 此外, [推送規則](../../push_rules/push_rules.html)提供服務器端控制和實施選項. 當前,有推送選項可用于: * [Skipping CI jobs](#push-options-for-gitlab-cicd) * [Merge requests](#push-options-for-merge-requests) **注意:** Git 推送選項僅在 Git 2.10 或更高版本中可用. 對于 2.10 至 2.17 版本的 Git,請使用`--push-option` : ``` git push --push-option=<push_option> ``` 對于 2.18 及更高版本,可以使用以上格式,或更短的`-o` : ``` git push -o <push_option> ``` ## Push options for GitLab CI/CD[](#push-options-for-gitlab-cicd "Permalink") 您可以使用推入選項跳過 CI / CD 管道或傳遞環境變量. | 推送選項 | Description | 版本介紹 | | --- | --- | --- | | `ci.skip` | 不要為最新推送創建 CI 管道. | [11.7](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/15643) | | `ci.variable="<name>=<value>"` | 如果由于推送而創建了[環境變量](../../ci/variables/README.html) ,請提供要在 CI 管道中使用的[環境變量](../../ci/variables/README.html) . | [12.6](https://gitlab.com/gitlab-org/gitlab/-/issues/27983) | 使用`ci.skip`的示例: ``` git push -o ci.skip ``` An example of passing some environment variables for a pipeline: ``` git push -o ci.variable="MAX_RETRIES=10" -o ci.variable="MAX_TIME=600" ``` ## Push options for merge requests[](#push-options-for-merge-requests "Permalink") 您可以在推送更改的同時使用 Git 推送選項對合并請求執行某些操作: | 推送選項 | Description | 版本介紹 | | --- | --- | --- | | `merge_request.create` | 為推送的分支創建一個新的合并請求. | [11.10](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/26752) | | `merge_request.target=<branch_name>` | 將合并請求的目標設置為特定分支. | [11.10](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/26752) | | `merge_request.merge_when_pipeline_succeeds` | 設置合并請求以[在其管道成功時](merge_requests/merge_when_pipeline_succeeds.html)進行[合并](merge_requests/merge_when_pipeline_succeeds.html) . | [11.10](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/26752) | | `merge_request.remove_source_branch` | 設置合并請求以在合并時刪除源分支. | [12.2](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/64320) | | `merge_request.title="<title>"` | 設置合并請求的標題. 例如: `git push -o merge_request.title="The title I want"` . | [12.2](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/64320) | | `merge_request.description="<description>"` | 設置合并請求的描述. 例如: `git push -o merge_request.description="The description I want"` . | [12.2](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/64320) | | `merge_request.label="<label>"` | 將標簽添加到合并請求. 如果標簽不存在,它將被創建. 例如,對于兩個標簽: `git push -o merge_request.label="label1" -o merge_request.label="label2"` . | [12.3](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/31831) | | `merge_request.unlabel="<label>"` | 從合并請求中刪除標簽. 例如,對于兩個標簽: `git push -o merge_request.unlabel="label1" -o merge_request.unlabel="label2"` . | [12.3](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/31831) | 如果您使用要求文本帶有空格的 push 選項,則需要用引號( `"` )括起來.如果沒有空格,則可以省略引號.例如: ``` git push -o merge_request.label="Label with spaces" git push -o merge_request.label=Label-with-no-spaces ``` 您可以通過使用多個`-o` (或`--push-option` )標志來組合推送選項以一次完成多個任務. 例如,如果您要創建一個新的合并請求,并定位一個名為`my-target-branch` : ``` git push -o merge_request.create -o merge_request.target=my-target-branch ``` 此外,如果希望合并請求在管道成功后立即合并,則可以執行以下操作: ``` git push -o merge_request.create -o merge_request.target=my-target-branch -o merge_request.merge_when_pipeline_succeeds ``` ## Useful Git aliases[](#useful-git-aliases "Permalink") 如上所示,Git 推送選項可能導致 Git 命令增長很長. 如果您經常使用相同的 push 選項,則創建[Git 別名會](https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases)很有用. Git 別名是 Git 的命令行快捷方式,可以大大簡化長 Git 命令的使用. ### Merge when pipeline succeeds alias[](#merge-when-pipeline-succeeds-alias "Permalink") 要[在管道成功執行 Git push 選項時](#push-options-for-merge-requests)為[合并](#push-options-for-merge-requests)設置 Git 別名: ``` git config --global alias.mwps "push -o merge_request.create -o merge_request.target=master -o merge_request.merge_when_pipeline_succeeds" ``` 然后,為了在管道成功時快速推送將針對 master 并合并的本地分支: ``` git mwps origin <local-branch-name> ```
                  <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>

                              哎呀哎呀视频在线观看