Skip to content

Git Checkout

Checks out a specific branch, tag, or commit.

Inputs#

Port Description
invalid port type: git-repo Repository
The Git repository to perform the checkout on.
Reference
The branch, tag, or commit hash to check out.
Create Branch
If true, creates a new branch with the 'Reference' name if it does not exist.
Force
If true, discards uncommitted local changes to force the checkout.

Outputs#

Port Description
Success
Executes if the checkout is successful.
Error
Executes if the checkout fails.

Addendum#

Updates the files in the working directory to match the version of a specific branch, tag, or commit.

The reference input can be a branch name (e.g., main), a tag (e.g., v1.2.0), or a commit hash.

Options#

  • Create Branch: If true, creates a new branch with the given reference name if it doesn't already exist. The new branch is created from the current HEAD.
  • Force: If true, discards any uncommitted local changes in the working directory to perform the checkout. Warning: This can lead to permanent data loss.

ID: core/git-checkout@v1