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