Git
The git
helper provides a thin wrapper around invoking the git executable for repository operations.
Methods
defaultBranch
Resolves the default branch, typically main
or master
, in the repository.
lastTag
Gets the last tag in the repository.
branch
Gets the current branch of the repository.
exec
Executes a git command in the repository and returns the stdout.
listBranches
Lists the branches in the git repository.
listFiles
Finds specific files in the git repository.
diff
Gets the diff for the current repository state.
log
Lists the commits in the git repository.
Configuring Ignores
Since GenAIScript uses git, it already supports the .gitignore
instructions. You can also provide additional repository-wide ignore through the .gitignore.genai
file at the workspace root.
Git in other repositories
Use git.client
to open a git client on a different working directory. This allows you to run git commands on a different repository.