import { ProjectOperationCredentials } from "../../operations/common/ProjectOperationCredentials"; import { RemoteRepoRef, RepoRef } from "../../operations/common/RepoId"; import { CloneOptions, DirectoryManager } from "../../spi/clone/DirectoryManager"; import { ReleaseFunction } from "../local/LocalProject"; import { NodeFsLocalProject } from "../local/NodeFsLocalProject"; import { Project } from "../Project"; import { GitProject, GitPushOptions } from "./GitProject"; import { GitStatus } from "./gitStatus"; export declare const DefaultDirectoryManager: DirectoryManager; /** * Implements GitProject interface using the Git binary from the command line. * Works only if git is installed. */ export declare class GitCommandGitProject extends NodeFsLocalProject implements GitProject { baseDir: string; private credentials; provenance?: string; static fromProject(p: Project, credentials: ProjectOperationCredentials): GitProject; /** * Create a project from an existing git directory * @param {RepoRef} id * @param {string} baseDir * @param {ProjectOperationCredentials} credentials * @param release call this when you're done with the project. make its filesystem resources available to others. * @param provenance optional; for debugging, describe how this was constructed * @return {GitCommandGitProject} */ static fromBaseDir(id: RepoRef, baseDir: string, credentials: ProjectOperationCredentials, release: ReleaseFunction, provenance?: string): GitCommandGitProject; /** * Create a new GitCommandGitProject by cloning the given remote project * @param {ProjectOperationCredentials} credentials * @param {RemoteRepoRef} id * @param {CloneOptions} opts * @param {DirectoryManager} directoryManager * @return {Promise} */ static cloned(credentials: ProjectOperationCredentials, id: RemoteRepoRef, opts?: CloneOptions, directoryManager?: DirectoryManager): Promise; branch: string; remote: string; newRepo: boolean; private constructor(); init(): Promise; isClean(): Promise; gitStatus(): Promise; /** * Remote is of form https://github.com/USERNAME/REPOSITORY.git * @param remote */ setRemote(remote: string): Promise; setUserConfig(user: string, email: string): Promise; createAndSetRemote(gid: RemoteRepoRef, description: string, visibility: "private" | "public"): Promise; configureFromRemote(): Promise; /** * Raise a PR after a push to this branch * @param title * @param body */ raisePullRequest(title: string, body?: string, targetBranch?: string): Promise; /** * `git add .` and `git commit -m MESSAGE` * @param {string} message Commit message * @returns {Promise} */ commit(message: string): Promise; /** * Check out a particular commit. We'll end in detached head state * @param ref branch or SHA * @return {any} */ checkout(ref: string): Promise; /** * Revert all changes since last commit * @return {any} */ revert(): Promise; push(options?: GitPushOptions): Promise; /** * Create branch from current HEAD. * @param name Name of branch to create. * @return project object */ createBranch(name: string): Promise; hasBranch(name: string): Promise; private gitInProjectBaseDir; }