import { type CallOptions } from './process.ts'; export declare class Git { static exe: string; cwd: string; constructor(cwd: string); static init(cwd: string, print?: boolean): Promise; static clone(repo: string, fpd: string, shallow?: boolean | string): Promise; call(args?: any[], { color, print, on_stderr, throw_code, }?: { color?: boolean; print?: CallOptions['print']; on_stderr?: CallOptions['on_stderr']; throw_code?: CallOptions['throw_code']; }): Promise>; get_branch(): Promise; /** - print: `true` */ get_branches(print?: boolean): Promise; has_branch(branch: string): Promise; /** - last?: `4` */ log({ n, graph, format, }?: { n?: number; graph?: boolean; format?: string; }): Promise>; get_last_commits(n?: number): Promise<{ time: Date; commiter: string; hash: string; message: string; }[]>; /** - short?: `true` */ get_last_commit_hash(short?: boolean): Promise; /** - all?: `false` fetch 所有的 remotes @example form.fetch({ remote: 'origin', args: ['pull/770/head:form-list-fields-value'] }) */ fetch({ print, remote, args, all }?: { print?: boolean; remote?: string; args?: string[]; all?: boolean; }): Promise; /** 创建或者切换到分支 - branch?: `'main'` */ checkout(branch?: 'main'): Promise; checkout(branch?: string): Promise; _checkout(branch: string, create: boolean, remote_branch?: string): Promise; /** 基于远程分支创建相同且干净的本地分支 (reset),用于 ci 会自动先通过 this.fetch 更新 remote_branch 对应的远程仓库 - branch: 远程分支名,必须类似 origin/main 这样的格式 */ checkout_remote(remote_branch: string): Promise; get_version_info(version?: string): Promise; /** 重置分支到最后提交的状态 */ reset(remote_branch?: string): Promise; } export interface GitVersionInfo { version: string; branch: string; time: string; hash: string; commiter: string; message: string; }