Cloud Source Repositories를 사용하여 빈 저장소를 새로 만들 수 있습니다. 저장소를 만들면 Cloud Source Repositories를 사용하여 프로젝트를 시작하거나 Git 저장소를 백업할 때 유용합니다.
시작하기 전에
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
- 
    
    
      In the Google Cloud console, on the project selector page, select or create a Google Cloud project. Roles required to select or create a project - Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
- 
      Create a project: To create a project, you need the Project Creator
      (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
 
- 
  
    Verify that billing is enabled for your Google Cloud project. 
- 
    
    
      In the Google Cloud console, on the project selector page, select or create a Google Cloud project. Roles required to select or create a project - Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
- 
      Create a project: To create a project, you need the Project Creator
      (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
 
- 
  
    Verify that billing is enabled for your Google Cloud project. 
- 
      Install the Google Cloud CLI. 
- 
          If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity. 
- 
        To initialize the gcloud CLI, run the following command: gcloud init
- 최신 버전의 Git이 있는지 확인합니다.
- Git에서 사용자 인증 정보를 구성하지 않은 경우 최초 설정 안내를 따르세요.
- Cloud Source Repositories API를 사용 설정합니다.
- Google Cloud 콘솔에서 Cloud Source Repositories를 엽니다. 
- 저장소 추가를 클릭합니다. - 저장소 추가 페이지가 열립니다. 
- 새 저장소 만들기를 선택하고 계속을 클릭합니다. - 새 저장소 만들기 페이지가 열립니다. 
- 저장소 이름 필드에 새 저장소의 이름을 입력합니다. - All-Users및- All-Projects이름은 제한된 이름이며 사용할 수 없습니다.
- 프로젝트 드롭다운 목록에서 저장소가 속한 Google Cloud프로젝트를 선택합니다. - 새 Google Cloud 프로젝트를 만들려면 프로젝트 만들기를 클릭합니다. 
- 만들기를 클릭합니다. - 저장소가 생성되고 저장소에 코드 추가 페이지가 열립니다. 이 페이지에서는 인증 유형에 따라 저장소를 로컬 머신으로 클론하거나 기존 저장소의 코드를 푸시하는 방법을 안내합니다. 
- 명령줄에서 다음을 호출합니다. - gcloud init gcloud source repos create [REPO_NAME]- 여기서 - [REPO_NAME]은 저장소의 이름입니다.- All-Users및- All-Projects이름은 제한된 이름이며 사용할 수 없습니다.
- 새 저장소 만들기 페이지에서 프로젝트 만들기를 클릭합니다. - Cloud 프로젝트 만들기 대화상자가 열립니다. 
- 프로젝트 이름 필드에 Google Cloud프로젝트의 이름을 입력합니다. 
- 프로젝트 ID 필드에서 생성된 프로젝트 ID를 사용하거나 프로젝트 ID 수정을 클릭하여 다른 ID를 입력합니다. 
- 결제 계정 드롭다운 목록에서 결제 계정을 선택합니다. - 결제 계정을 만들려면 결제 계정 만들기를 클릭합니다. 
- 만들기를 클릭합니다. 
- 로컬 머신에 새 저장소 클론
- 로컬 머신의 기존 저장소에서 코드 푸시
Cloud Source Repositories API 사용 설정
새 저장소 만들기
 Google Cloud 콘솔 또는 gcloud 명령줄 도구를 사용하여 저장소를 만들 수 있습니다.
콘솔
gcloud
프로젝트 만들기
모든 저장소는 Google Cloud 프로젝트에 속해야 합니다. Google Cloud 프로젝트가 없으면 다음 단계에 따라 하나 만듭니다.
새 저장소 만들기를 계속할 수 있습니다.
다음 단계
이제 Cloud Source Repositories에 저장소가 있으므로 다음 중 원하는 프로세스를 선택하여 코드를 추가할 수 있습니다.