gitops

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package gitops provides Git operations interface and implementations.

This code is adapted from git-mcp-go by Gero Posmyk-Leinemann and contributors. Original source: https://github.com/geropl/git-mcp-go Copyright (c) Gero Posmyk-Leinemann <[email protected]>

Package gitops provides Git operations interface and implementations.

This code is adapted from git-mcp-go by Gero Posmyk-Leinemann and contributors. Original source: https://github.com/geropl/git-mcp-go Copyright (c) Gero Posmyk-Leinemann <[email protected]>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunGitCommand

func RunGitCommand(repoPath string, args ...string) (string, error)

RunGitCommand runs a git command and returns its output

Types

type GitOperations

type GitOperations interface {
	GetStatus(repoPath string) (string, error)
	GetDiffUnstaged(repoPath string) (string, error)
	GetDiffStaged(repoPath string) (string, error)
	GetDiff(repoPath string, target string) (string, error)
	CommitChanges(repoPath string, message string) (string, error)
	AddFiles(repoPath string, files []string) (string, error)
	ResetStaged(repoPath string) (string, error)
	GetLog(repoPath string, maxCount int) ([]string, error)
	CreateBranch(repoPath string, branchName string, baseBranch string) (string, error)
	CheckoutBranch(repoPath string, branchName string) (string, error)
	InitRepo(repoPath string) (string, error)
	ShowCommit(repoPath string, revision string) (string, error)
	PushChanges(repoPath string, remote string, branch string) (string, error)
	PullChanges(repoPath string, remote string, branch string) (string, error)
	ApplyPatchFromString(repoPath string, patchString string) (string, error)
	ApplyPatchFromFile(repoPath string, patchFilePath string) (string, error)
	// Worktree operations
	ListWorktrees(repoPath string) (string, error)
	AddWorktree(repoPath string, worktreePath string, commitish string, options []string) (string, error)
	RemoveWorktree(repoPath string, worktreeName string, force bool) (string, error)
	LockWorktree(repoPath string, worktreeName string, reason string) (string, error)
	UnlockWorktree(repoPath string, worktreeName string) (string, error)
	PruneWorktrees(repoPath string, dryRun bool, verbose bool) (string, error)
}

GitOperations defines the interface for Git operations

Directories

Path Synopsis
Package shell provides Git operations using git CLI commands.
Package shell provides Git operations using git CLI commands.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL