sync-worktrees
Version:
Automatically synchronize Git worktrees with remote branches - perfect for multi-branch development workflows
49 lines • 2.07 kB
TypeScript
import type { Config } from "../types";
import type { SimpleGit } from "simple-git";
export declare class GitService {
private config;
private git;
private bareRepoPath;
private mainWorktreePath;
private defaultBranch;
private metadataService;
constructor(config: Config);
initialize(): Promise<SimpleGit>;
getGit(): SimpleGit;
getDefaultBranch(): string;
fetchAll(): Promise<void>;
fetchBranch(branchName: string): Promise<void>;
getRemoteBranches(): Promise<string[]>;
getRemoteBranchesWithActivity(): Promise<{
branch: string;
lastActivity: Date;
}[]>;
private createWorktreeMetadata;
addWorktree(branchName: string, worktreePath: string): Promise<void>;
removeWorktree(worktreePath: string): Promise<void>;
pruneWorktrees(): Promise<void>;
checkWorktreeStatus(worktreePath: string): Promise<boolean>;
private isDetachedHead;
hasUnpushedCommits(worktreePath: string): Promise<boolean>;
hasUpstreamGone(worktreePath: string): Promise<boolean>;
hasStashedChanges(worktreePath: string): Promise<boolean>;
hasModifiedSubmodules(worktreePath: string): Promise<boolean>;
hasOperationInProgress(worktreePath: string): Promise<boolean>;
getCurrentBranch(): Promise<string>;
private detectDefaultBranch;
private isLfsSkipEnabled;
getWorktrees(): Promise<{
path: string;
branch: string;
}[]>;
isWorktreeBehind(worktreePath: string): Promise<boolean>;
updateWorktree(worktreePath: string): Promise<void>;
hasDivergedHistory(worktreePath: string, expectedBranch: string): Promise<boolean>;
canFastForward(worktreePath: string, branch: string): Promise<boolean>;
compareTreeContent(worktreePath: string, branch: string): Promise<boolean>;
resetToUpstream(worktreePath: string, branch: string): Promise<void>;
getCurrentCommit(worktreePath: string): Promise<string>;
getRemoteCommit(ref: string): Promise<string>;
private getWorktreesFromBare;
}
//# sourceMappingURL=git.service.d.ts.map