/** * Service for Git operations * Single Responsibility: Local git repository operations * * An optional `cwd` may be supplied to the constructor to run every git command * in a specific repository directory (used by multi-repo `--folder` fan-out). * When omitted (the default for every existing caller) commands run in the * process working directory exactly as before. */ export declare class GitService { private readonly cwd?; /** * @param cwd - Optional working directory for all git commands. Undefined * preserves the historical process-cwd behavior. */ constructor(cwd?: string | undefined); /** * Run a git command in this service's configured working directory. */ private run; /** * Run a git command (returning the full result) in this service's cwd. */ private runDetailed; /** * Get current git branch */ getCurrentBranch(): Promise; /** * Checkout a branch */ checkout(branch: string): Promise; /** * Create a new branch */ createBranch(name: string, startPoint?: string): Promise; /** * Delete a local branch */ deleteBranch(branch: string, force?: boolean): Promise; /** * Check if working directory is clean (no uncommitted changes) */ isClean(): Promise; /** * Merge a branch into current branch */ merge(source: string, options?: { noFf?: boolean; squash?: boolean; }): Promise; /** * Fetch from remote */ fetch(remote?: string, branch?: string): Promise; /** * Pull from remote */ pull(remote?: string, branch?: string): Promise; /** * Push to remote */ push(branch?: string, remote?: string, force?: boolean): Promise; /** * Check if a branch exists locally */ branchExists(branch: string): Promise; /** * Check if a remote branch exists */ remoteBranchExists(branch: string, remote?: string): Promise; /** * Get list of changed files */ getChangedFiles(): Promise; /** * Check if we're in a git repository */ isGitRepo(): Promise; /** * Get repository root directory */ getRepoRoot(): Promise; /** * Remove a file from the git index only (keeps file on disk) */ rmCached(filePath: string): Promise; /** * Reset a file in the index to match HEAD (unstages changes for that file) */ resetFile(filePath: string): Promise; /** * Stash current changes with a message */ stash(message?: string): Promise; /** * Stash current changes including untracked files */ stashIncludingUntracked(message?: string): Promise; /** * Count the number of stash entries */ stashCount(): Promise; /** * Pop the most recent stash */ stashPop(): Promise; /** * Checkout a file from another branch/ref into the working tree */ checkoutFileFromRef(ref: string, filePath: string): Promise; /** * Stage a specific file */ addFile(filePath: string): Promise; /** * Create a commit with the given message */ commit(message: string): Promise; /** * Push to remote with --no-verify flag (skips git push hooks) */ pushNoVerify(branch: string, remote?: string): Promise; /** * Check if a file exists on a given git ref (branch, tag, or commit) */ fileExistsOnRef(ref: string, relativePath: string): Promise; /** * Read the content of a file from a given git ref. * Returns the raw file content as a string (git appends a trailing newline, * matching what is committed on the ref). * Throws if the ref or path is invalid, or if the file does not exist on the ref. */ showFile(ref: string, relativePath: string): Promise; /** * Check if local branch is behind remote */ isBehindRemote(branch: string, remote?: string): Promise; /** * Get remote repository information (owner and repo name) * Parses the git remote URL to extract GitHub owner/repo * @param remote - The remote name (default: "origin") * @returns Object with owner and repo, or null if not a valid GitHub remote */ getRemoteRepository(remote?: string): Promise<{ owner: string; repo: string; } | null>; } //# sourceMappingURL=GitService.d.ts.map