(options?: SpawnOptions | undefined): Promise<string | null> options?
SpawnOptions | undefinedreturns
Promise<string | null> an error message if the git workspace has any unstaged or uncommitted changes, or null if it's clean
25 declarations
(options?: SpawnOptions | undefined): Promise<string | null> options?SpawnOptions | undefinedPromise<string | null> an error message if the git workspace has any unstaged or uncommitted changes, or null if it's clean
(options?: SpawnOptions | undefined): Promise<string | null> options?SpawnOptions | undefinedPromise<string | null> an error message if the git workspace has any unstaged changes or untracked files, or null if fully staged
(options?: SpawnOptions | undefined): Promise<boolean> Returns the global git config setting for pull.rebase.
options?SpawnOptions | undefinedPromise<boolean> (options?: SpawnOptions | undefined): Promise<GitWorkspaceStatus> Checks the git workspace status using a single git status --porcelain -z call.
The -z format provides more reliable parsing by using NUL separators and avoiding escaping.
options?SpawnOptions | undefinedPromise<GitWorkspaceStatus> status object with flags for unstaged changes, staged changes, and untracked files
(branch: GitBranch, options?: SpawnOptions | undefined): Promise<GitBranch | null> Calls git checkout and throws if anything goes wrong.
branchoptions?SpawnOptions | undefinedPromise<GitBranch | null> the previous branch name, if it changed
(origin: GitOrigin, branch: GitBranch, source_dir: string, target_dir: string, options?: SpawnOptions | undefined): Promise<void> Clones a branch locally to another directory and updates the origin to match the source.
originbranchsource_dirstringtarget_dirstringoptions?SpawnOptions | undefinedPromise<void> (options?: SpawnOptions | undefined): Promise<string> Returns the hash of the current branch's first commit or throws if something goes wrong.
options?SpawnOptions | undefinedPromise<string> (options?: SpawnOptions | undefined): Promise<GitBranch> Returns the current git branch name or throws if something goes wrong.
options?SpawnOptions | undefinedPromise<GitBranch> (branch?: string | undefined, options?: SpawnOptions | undefined): Promise<string | null> Returns the branch's latest commit hash or throws if something goes wrong.
branch?string | undefinedoptions?SpawnOptions | undefinedPromise<string | null> (branch: GitBranch, options?: SpawnOptions | undefined): Promise<void> Deletes a branch locally and throws if anything goes wrong.
branchoptions?SpawnOptions | undefinedPromise<void> (origin: GitOrigin, branch: GitBranch, options?: SpawnOptions | undefined): Promise<void> Deletes a branch remotely and throws if anything goes wrong.
originbranchoptions?SpawnOptions | undefinedPromise<void> (origin?: GitOrigin, branch?: GitBranch | undefined, options?: SpawnOptions | undefined): Promise<void> Calls git fetch and throws if anything goes wrong.
origin'origin' as GitOriginbranch?GitBranch | undefinedoptions?SpawnOptions | undefinedPromise<void> (branch: GitBranch, options?: SpawnOptions | undefined): Promise<boolean> branchoptions?SpawnOptions | undefinedPromise<boolean> a boolean indicating if the local git branch exists
(stdout: string | null): GitWorkspaceStatus Parses the output of git status --porcelain -z (v1 format) into a status object.
This is a pure function that can be tested independently.
Format: XY path\0 where: - X = staged status (index) - Y = unstaged status (work tree) - path = file path (unescaped with -z)
Supported status codes: - M = modified - A = added - D = deleted - R = renamed - C = copied - T = type changed (regular file, symbolic link or submodule) - U = unmerged - ? = untracked - ! = ignored
For renames/copies: XY new\0old\0 (two NUL-separated paths)
Note: This implementation treats submodules the same as regular files. Submodule-specific status codes (lowercase m, ?) are interpreted as changes.
stdout- The raw output from git status --porcelain -z
string | nullGitWorkspaceStatus status object with flags for unstaged changes, staged changes, and untracked files
(origin?: GitOrigin, branch?: GitBranch | undefined, options?: SpawnOptions | undefined): Promise<void> Calls git pull and throws if anything goes wrong.
origin'origin' as GitOriginbranch?GitBranch | undefinedoptions?SpawnOptions | undefinedPromise<void> (origin: GitOrigin, branch?: GitBranch | undefined, options?: SpawnOptions | undefined, set_upstream?: boolean): Promise<void> Calls git push and throws if anything goes wrong.
originbranch?GitBranch | undefinedoptions?SpawnOptions | undefinedset_upstreambooleanfalsePromise<void> (origin?: GitOrigin, branch?: GitBranch | undefined, options?: SpawnOptions | undefined): Promise<void> Calls git push and throws if anything goes wrong.
origin'origin' as GitOriginbranch?GitBranch | undefinedoptions?SpawnOptions | undefinedPromise<void> (origin?: GitOrigin, branch?: GitBranch | undefined, options?: SpawnOptions | undefined): Promise<boolean> origin'origin' as GitOriginbranch?GitBranch | undefinedoptions?SpawnOptions | undefinedPromise<boolean> a boolean indicating if the remote git branch exists
(origin: GitOrigin, branch: GitBranch, options?: SpawnOptions | undefined): Promise<void> Resets the target branch back to its first commit both locally and remotely.
originbranchoptions?SpawnOptions | undefinedPromise<void> (status: GitWorkspaceStatus): boolean statusboolean true if the workspace has no changes at all
(status: GitWorkspaceStatus): boolean statusboolean true if the workspace has no unstaged changes and no untracked files (staged changes are OK)
(status: GitWorkspaceStatus): string Converts a workspace status to a human-readable message.
statusstring ZodString ZodString GitWorkspaceStatus Git workspace status flags indicating which types of changes are present.
unstaged_changesbooleanstaged_changesbooleanuntracked_filesboolean