UNPKG

@push.rocks/smartgit

Version:

A smart wrapper for nodegit that simplifies Git operations in Node.js.

46 lines (45 loc) 1.56 kB
import { Smartgit } from './smartgit.classes.smartgit.js'; /** * class GitRepo allows access to git directories from node */ export declare class GitRepo { /** * creates a new GitRepo Instance after cloning a project */ static fromCloningIntoDir(smartgitRefArg: Smartgit, fromArg: string, toArg: string): Promise<GitRepo>; static fromCreatingRepoInDir(smartgitRefArg: Smartgit, dirArg: string): Promise<GitRepo>; static fromOpeningRepoDir(smartgitRefArg: Smartgit, dirArg: string): Promise<GitRepo>; smartgitRef: Smartgit; repoDir: string; constructor(smartgitRefArg: Smartgit, repoDirArg: string); /** * lists remotes */ listRemotes(): Promise<{ remote: string; url: string; }[]>; /** * ensures the existence of a remote within a repository * @param remoteNameArg * @param remoteUrlArg */ ensureRemote(remoteNameArg: string, remoteUrlArg: string): Promise<void>; /** * gets the url for a specific remote */ getUrlForRemote(remoteName: string): Promise<string>; pushBranchToRemote(branchName: string, remoteName: string): Promise<void>; /** * Get the diff of the current uncommitted changes while excluding specified files */ getUncommittedDiff(excludeFiles?: string[]): Promise<string[]>; /** * Get all commit messages with their dates and package.json version at each commit */ getAllCommitMessages(): Promise<{ date: string; version: string; message: string; }[]>; }