gcloud alpha source repos clone

NAME
gcloud alpha source repos clone - clone a cloud source repository
SYNOPSIS
gcloud alpha source repos cloneREPOSITORY_NAME[DIRECTORY_NAME][--dry-run][--use-full-gcloud-path][GCLOUD_WIDE_FLAG]
DESCRIPTION
(ALPHA) This command clones a git repository from the currentlyactive Google Cloud project into the specified directory or into the currentdirectory if no target directory is specified.

Each Google Cloud project can have zero or more git repositories associated withit. To see the available repositories, run:

gcloudalphasourcereposlist

The clone operation configures the local clone to use your gcloud credentials toauthenticate future git operations. This command emits a warning if the cloudsource repository is a mirror.

EXAMPLES
The example commands below show a sample workflow.
gcloudinit
gcloudalphasourcereposcloneREPOSITORY_NAMEDIRECTORY_NAME
cdDIRECTORY_NAMEcreate/editfilesandcreateoneormorecommits
gitpushoriginmain
POSITIONAL ARGUMENTS
REPOSITORY_NAME
Name of the repository.
[DIRECTORY_NAME]
Directory name for the cloned repo. Defaults to the repository name.
FLAGS
--dry-run
If provided, prints the command that would be run to standard out instead ofexecuting it.
--use-full-gcloud-path
If provided, use the full gcloud path for the git credential.helper. Using thefull path means that gcloud does not need to be in the path for future gitoperations on the repository.
GCLOUD WIDE FLAGS
These flags are available to all commands:--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.

Run$gcloud help for details.

NOTES
This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. These variants are also available:
gcloudsourcereposclone
gcloudbetasourcereposclone

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-05-07 UTC.