icon

Git Clone Repository

Checks out the repository, updates submodules and exports git metadata as Step outputs.

The checkout process depends on the Step settings and the build trigger parameters (coming from your git server).

Depending on the conditions, the step can checkout:

  • the merged state of a Pull Request
  • the head of a Pull Request
  • a git tag
  • a specific commit (by hash)
  • a commit on a specific branch
  • the head of a branch

The Step also supports more advanced features, such as updating submodules and sparse checkouts.

Configuring the Step

The step should work with its default configuration if build triggers and webhooks are set up correctly.

By default, the Step performs a shallow clone in most cases (fetching only the latest commit) to make the clone fast and efficient. If your workflow requires a deeper commit history, you can override this using the Clone depth input.

Useful links

Related Steps

Similar steps

Make sure your repo is clean as a whistle, no uncommitted changes, nothing to hide.

Generates a changelog for deployment between two tags

Reads the date of the last git commit

A simple step that create a tag to the current commit