git_fetch
git_fetch
def git_fetch(
*,
name: str,
default_target_platform: None | str = None,
target_compatible_with: list[str] = [],
compatible_with: list[str] = [],
exec_compatible_with: list[str] = [],
visibility: list[str] = [],
within_view: list[str] = ["PUBLIC"],
metadata: OpaqueMetadata = {},
tests: list[str] = [],
modifiers: OpaqueMetadata = [],
_apple_platforms: dict[str, str] = {},
_git_fetch_tool: str = "prelude//git/tools:git_fetch",
allow_cache_upload: bool = True,
contacts: list[str] = [],
default_host_platform: None | str = None,
labels: list[str] = [],
licenses: list[str] = [],
repo: str,
rev: str,
sub_targets: list[str] = [],
) -> None
Checkout a commit from a git repository.
Parameters
name
: name of the targetdefault_target_platform
: specifies the default target platform, used when no platforms are specified on the command linetarget_compatible_with
: a list of constraints that are required to be satisfied for this target to be compatible with a configurationcompatible_with
: a list of constraints that are required to be satisfied for this target to be compatible with a configurationexec_compatible_with
: a list of constraints that are required to be satisfied for this target to be compatible with an execution platformvisibility
: a list of visibility patterns restricting what targets can depend on this onewithin_view
: a list of visibility patterns restricting what this target can depend onmetadata
: a key-value map of metadata associated with this targettests
: a list of targets that provide tests for this onemodifiers
: an array of modifiers associated with this targetallow_cache_upload
: Whether the results of the fetch can be written to the action cache and CAS.repo
: Url suitable as a git remote.rev
: 40-digit hex SHA-1 of the git commit.sub_targets
: A list of paths within the remote repo to be made accessible as sub-targets. For example if we have a git_fetch withname = "serde.git"
andsub_targets = ["serde_derive"]
, then other targets would be able to refer to the serde_derive subdirectory of the repo as":serde.git[serde_derive]"
.
Details
Examples:
git_fetch(
name = "serde.git",
repo = "https://github.com/serde-rs/serde",
rev = "fccb9499bccbaca0b7eef91a3a82dfcb31e0b149",
)