このコンテンツはまだ日本語訳がありません。
Git
Git operations facade for a specific Sandbox.
Provides repository clone, branch, commit, status, and sync operations mapped to Daytona toolbox Git endpoints.
Methods
clone()
public void clone(String url, String path)Clones a Git repository into the specified path.
Parameters:
urlString - repository URLpathString - destination path in the Sandbox
Throws:
io.daytona.sdk.exception.DaytonaException- if cloning fails
clone()
public void clone(String url, String path, String branch, String commitId, String username, String password)Clones a repository with optional branch, commit, and credentials.
Parameters:
urlString - repository URLpathString - destination path in the SandboxbranchString - branch to clone;nulluses default branchcommitIdString - commit SHA to checkout after clone;nullskips detached checkoutusernameString - username for authenticated remotespasswordString - password or token for authenticated remotes
Throws:
io.daytona.sdk.exception.DaytonaException- if cloning fails
branches()
public Map<String, Object> branches(String path)Lists branches in a repository.
Parameters:
pathString - repository path in the Sandbox
Returns:
Map\<String, Object\>- map containingbrancheslist
Throws:
io.daytona.sdk.exception.DaytonaException- if the operation fails
add()
public void add(String path, List<String> files)Stages files for commit.
Parameters:
pathString - repository path in the SandboxfilesList<String> - file paths to stage relative to repository root
Throws:
io.daytona.sdk.exception.DaytonaException- if staging fails
commit()
public GitCommitResponse commit(String path, String message, String author, String email)Creates a commit from staged changes.
Parameters:
pathString - repository path in the SandboxmessageString - commit messageauthorString - author display nameemailString - author email address
Returns:
GitCommitResponse- commit metadata containing resulting hash
Throws:
io.daytona.sdk.exception.DaytonaException- if commit fails
status()
public GitStatus status(String path)Retrieves Git status for a repository.
Parameters:
pathString - repository path in the Sandbox
Returns:
GitStatus- repository status including branch divergence and file status entries
Throws:
io.daytona.sdk.exception.DaytonaException- if the operation fails
push()
public void push(String path)Pushes local commits to remote.
Parameters:
pathString - repository path in the Sandbox
Throws:
io.daytona.sdk.exception.DaytonaException- if push fails
pull()
public void pull(String path)Pulls updates from remote.
Parameters:
pathString - repository path in the Sandbox
Throws:
io.daytona.sdk.exception.DaytonaException- if pull fails