steps.checkout 정의

를 사용하여 checkout 파이프라인이 소스 코드를 체크 아웃하는 방법을 구성합니다.

steps:
- checkout: string # Required as first property. Configures checkout for the specified repository.
  clean: string # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
  fetchDepth: string # Depth of Git graph to fetch.
  fetchTags: string # Set to 'true' to sync tags when fetching the repo, or 'false' to not sync tags. See remarks for the default behavior.
  lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
  persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
  submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
  path: string # Where to put the repository. The root directory is $(Pipeline.Workspace).
  condition: string # Evaluate this condition expression to determine whether to run this task.
  continueOnError: boolean # Continue running even on failure?
  displayName: string # Human-readable name for the task.
  target: string | target # Environment in which to run this task.
  enabled: boolean # Run this task when the job runs?
  env: # Variables to map into the process's environment.
    string: string # Name/value pairs
  name: string # ID of the step.
  timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.
  retryCountOnTaskFailure: string # Number of retries if the task fails.
steps:
- checkout: string # Required as first property. Configures checkout for the specified repository.
  clean: string # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
  fetchDepth: string # Depth of Git graph to fetch.
  lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
  persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
  submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
  path: string # Where to put the repository. The root directory is $(Pipeline.Workspace).
  condition: string # Evaluate this condition expression to determine whether to run this task.
  continueOnError: boolean # Continue running even on failure?
  displayName: string # Human-readable name for the task.
  target: string | target # Environment in which to run this task.
  enabled: boolean # Run this task when the job runs?
  env: # Variables to map into the process's environment.
    string: string # Name/value pairs
  name: string # ID of the step.
  timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.
  retryCountOnTaskFailure: string # Number of retries if the task fails.
steps:
- checkout: string # Required as first property. Configures checkout for the specified repository.
  clean: string # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
  fetchDepth: string # Depth of Git graph to fetch.
  lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
  persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
  submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
  path: string # Where to put the repository. The root directory is $(Pipeline.Workspace).
  condition: string # Evaluate this condition expression to determine whether to run this task.
  continueOnError: boolean # Continue running even on failure?
  displayName: string # Human-readable name for the task.
  target: string | target # Environment in which to run this task.
  enabled: boolean # Run this task when the job runs?
  env: # Variables to map into the process's environment.
    string: string # Name/value pairs
  name: string # ID of the step.
  timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.
steps:
- checkout: string # Required as first property. Whether or not to check out the repository containing this pipeline definition.
  clean: string # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
  fetchDepth: string # Depth of Git graph to fetch.
  lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
  persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
  submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
  path: string # Where to put the repository. The root directory is $(Pipeline.Workspace).
  condition: string # Evaluate this condition expression to determine whether to run this task.
  continueOnError: boolean # Continue running even on failure?
  displayName: string # Human-readable name for the task.
  enabled: boolean # Run this task when the job runs?
  env: # Variables to map into the process's environment.
    string: string # Name/value pairs
  name: string # ID of the step.
  timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.
steps:
- checkout: string # Required as first property. Whether or not to check out the repository containing this pipeline definition.
  clean: string # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
  fetchDepth: string # Depth of Git graph to fetch.
  lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
  persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
  submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
  condition: string # Evaluate this condition expression to determine whether to run this task.
  continueOnError: boolean # Continue running even on failure?
  displayName: string # Human-readable name for the task.
  enabled: boolean # Run this task when the job runs?
  env: # Variables to map into the process's environment.
    string: string # Name/value pairs
  name: string # ID of the step.
  timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.

이 정의를 참조하는 정의: 단계

속성

checkout 문자열. 첫 번째 속성으로 필요합니다.
지정된 리포지토리에 대한 체크 아웃을 구성합니다. , none, 리포지토리 이름 또는 리포지토리 리소스를 지정self합니다. 자세한 내용은 파이프라인에서 여러 리포지토리 확인을 참조하세요.

참고

단계가 없 checkout 으면 의 및 에 대해 jobs.job.step.checkoutnonejobs.deployment.steps.checkout기본값이 로 설정됩니다.self

checkout 문자열. 첫 번째 속성으로 필요합니다.
이 파이프라인 정의를 포함하는 리포지토리를 검사 여부입니다. self 또는 none를 지정합니다.

clean 문자열.
true이면 가져오기 전에 git 클린 -ffdx와 git reset --hard HEAD 실행합니다. true | False.

fetchDepth 문자열.
가져올 Git 그래프의 깊이입니다.

fetchTags 문자열.
리포지토리를 가져올 때 태그를 동기화하려면 'true'로 설정하거나 태그를 동기화하지 않도록 'false'로 설정합니다. 기본 동작은 설명을 참조하세요.

lfs 문자열.
Git-LFS 파일을 다운로드하려면 'true'로 설정합니다. 기본값은 다운로드하지 않는 것입니다.

persistCredentials 문자열.
초기 페치 후 OAuth 토큰을 Git 구성에 그대로 두려면 'true'로 설정합니다. 기본값은 그대로 두지 않는 것입니다.

submodules 문자열.
하위 모듈의 하위 모듈을 얻으려면 단일 수준의 하위 모듈 또는 '재귀'에 대해 'true'로 설정합니다. 기본값은 하위 모듈을 가져오지 않는 것입니다.

path 문자열.
리포지토리를 배치할 위치입니다. 루트 디렉터리가 $(Pipeline.Workspace)입니다.

condition 문자열.
이 조건 식을 평가하여 이 작업을 실행할지 여부를 결정합니다.

continueOnError부울입니다.
오류 발생 시에도 계속 실행하시겠습니까?

displayName 문자열.
작업에 대한 사람이 읽을 수 있는 이름입니다.

target대상입니다.
이 작업을 실행할 환경입니다.

enabled부울입니다.
작업이 실행되면 이 작업을 실행하시겠습니까?

env 문자열 사전입니다.
프로세스 환경에 매핑할 변수입니다.

name 문자열.
단계의 ID입니다. 허용되는 값: [-_A-Za-z0-9]*.

timeoutInMinutes 문자열.
서버가 이 작업을 종료하기 전에 이 작업이 완료되기를 기다리는 시간입니다.

참고

파이프라인은 작업 수준 시간 제한으로 구성할 수 있습니다. 단계가 완료되기 전에 작업 수준 제한 시간 간격이 경과하면 단계가 더 긴 timeoutInMinutes 간격으로 구성된 경우에도 실행 중인 작업(단계 포함)이 종료됩니다. 자세한 내용은 시간 제한을 참조하세요.

retryCountOnTaskFailure 문자열.
작업이 실패할 경우 다시 시도 횟수입니다.

설명

얕은 인출

중요

2022년 9월 Azure DevOps 스프린트 209 업데이트 이후에 만든 새 파이프라인에는 기본적으로 단순 페치를 사용하도록 설정하고 깊이 1로 구성됩니다. 이전에는 기본값이 단순 인출이 아니었습니다. 파이프라인을 검사 파이프라인 설정 UI에서 단순 페치 설정을 확인합니다.

단순 인출을 사용하지 않도록 설정하려면 다음 두 가지 옵션 중 하나를 수행할 수 있습니다.

  • 파이프라인 설정 UI에서 단순 인출 옵션을 사용하지 않도록 설정합니다.
  • 단계에서 명시적으로 설정합니다 fetchDepth: 0checkout .

파이프라인에 대한 페치 깊이를 구성하려면 단계에서 속성을 checkout 설정 fetchDepth 하거나 파이프라인 설정 UI에서 단순 페치 설정을 구성할 수 있습니다.

참고

단계에서 명시적으로 설정하는 fetchDepthcheckout 경우 해당 설정은 파이프라인 설정 UI에 구성된 설정보다 우선합니다. 설정 fetchDepth: 0 은 모든 기록을 가져오고 단순 페치 설정을 재정의합니다.

Clean 속성

속성이 clean 설정되지 않은 경우 기본값은 기본적으로 true로 설정된 YAML 파이프라인에 대한 UI 설정의 클린 설정에 의해 구성됩니다. 를 사용하여 checkout사용할 수 있는 정리 옵션 외에도 작업 영역에서 정리를 구성할 수도 있습니다. 작업 영역 및 클린 옵션에 대한 자세한 내용은 작업에서 작업 영역 항목을 참조하세요.

태그 동기화

체크 아웃 단계에서는 Git 리포지토리의 콘텐츠를 가져올 때 옵션을 사용합니다 --tags . 이로 인해 서버는 모든 태그와 해당 태그가 가리키는 모든 개체를 가져옵니다. 이렇게 하면 특히 많은 태그가 있는 큰 리포지토리가 있는 경우 파이프라인에서 작업을 실행하는 시간이 늘어나게 됩니다. 또한 체크 아웃 단계는 단순 페치 옵션을 사용하도록 설정하더라도 태그를 동기화하므로 목적이 무용지물이 될 수 있습니다. Git 리포지토리에서 가져오거나 가져온 데이터의 양을 줄이기 위해 Microsoft는 태그 동기화 동작을 제어하는 새로운 체크 아웃 옵션을 추가했습니다. 이 옵션은 클래식 및 YAML 파이프라인 모두에서 사용할 수 있습니다.

리포지토리를 체크 아웃할 때 태그를 동기화할지 여부는 YAML에서 속성을 설정하고 fetchTags태그 동기화 설정을 구성하여 UI에서 구성할 수 있습니다.

YAML에서 설정을 구성하려면 속성을 설정합니다 fetchTags .

steps:
- checkout: self
  fetchTags: true

파이프라인 UI에서 설정을 구성하려면 YAML 파이프라인을 편집하고 추가 작업, 트리거, YAML, 원본 가져오기 및 검사 선택하거나 동기화 태그 확인란을 선택 취소합니다. 자세한 내용은 태그 동기화를 참조하세요.

기본 동작

  • 2022년 9월에 릴리스된 Azure DevOps 스프린트 209 릴리스 전에 만든 기존 파이프라인의 경우 동기화 태그 옵션이 추가되기 전에 태그 동기화의 기본값은 기존 동작과 동일하게 유지됩니다()true.
  • Azure DevOps 스프린트 릴리스 209 이후에 만든 새 파이프라인의 경우 태그 동기화의 기본값은 입니다 false.

중요

UI에서 true의 동기화 태그 설정이 YAML의 fetchTags: false 문보다 우선합니다. 동기화 태그가 UI에서 true로 설정된 경우 YAML에서 가 false로 설정된 경우에도 fetchTags 태그가 동기화됩니다.

예제

원본 동기화를 방지하려면 다음을 수행합니다.

steps:
- checkout: none

참고

로컬 서비스 계정에서 에이전트를 실행하고 git 작업을 사용하거나 git 하위 모듈을 로드하여 현재 리포지토리를 수정하려는 경우 프로젝트 컬렉션 빌드 서비스 계정 사용자에게 적절한 권한을 부여합니다.

- checkout: self
  submodules: true
  persistCredentials: true

파이프라인에서 여러 리포지토리를 검사 여러 단계를 사용합니다checkout.

- checkout: self
- checkout: git://MyProject/MyRepo
- checkout: MyGitHubRepo # Repo declared in a repository resource

자세한 내용은 파이프라인에서 여러 리포지토리 확인을 참조하세요.

추가 정보