gitops

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HooksInstalled

func HooksInstalled(claudeDir string) bool

HooksInstalled checks if enclaude hooks are present in settings.json.

func InstallHooks

func InstallHooks(claudeDir string) error

InstallHooks adds enclaude hooks to settings.json without disturbing existing hooks.

func RemoveHooks

func RemoveHooks(claudeDir string) error

RemoveHooks removes enclaude hooks from settings.json.

Types

type Git

type Git struct {
	// contains filtered or unexported fields
}

Git wraps git CLI operations for a repository.

func New

func New(repoDir string) *Git

New creates a Git instance for the given repo directory.

func (*Git) Add

func (g *Git) Add(paths ...string) error

Add stages files.

func (*Git) AddAll

func (g *Git) AddAll() error

AddAll stages all changes.

func (*Git) Checkout

func (g *Git) Checkout(ref string, paths ...string) (string, error)

Checkout restores files from a specific ref.

func (*Git) Commit

func (g *Git) Commit(msg string) error

Commit creates a commit with the given message.

func (*Git) ConfigMergeDriver

func (g *Git) ConfigMergeDriver(name, driverCmd string) error

ConfigMergeDriver registers a custom merge driver.

func (*Git) CurrentBranch

func (g *Git) CurrentBranch() (string, error)

CurrentBranch returns the current branch name.

func (*Git) Fetch

func (g *Git) Fetch(remote string) (string, error)

Fetch fetches from the given remote.

func (*Git) HasChanges

func (g *Git) HasChanges() bool

HasChanges returns true if there are staged or unstaged changes.

func (*Git) HasRemote

func (g *Git) HasRemote(name string) bool

HasRemote checks if a remote with the given name exists.

func (*Git) HasUpstream

func (g *Git) HasUpstream() bool

HasUpstream checks if the current branch has an upstream configured.

func (*Git) Init

func (g *Git) Init() error

Init initializes a new git repository.

func (*Git) Log

func (g *Git) Log(n int) (string, error)

Log returns the git log in oneline format.

func (*Git) LogFull

func (g *Git) LogFull(n int) (string, error)

LogFull returns detailed git log.

func (*Git) Merge

func (g *Git) Merge(ref string) (string, error)

Merge merges the given ref into the current branch.

func (*Git) MergeAbort

func (g *Git) MergeAbort() error

MergeAbort aborts a merge in progress.

func (*Git) Pull

func (g *Git) Pull(remote, branch string) (string, error)

Pull pulls from the given remote and branch.

func (*Git) Push

func (g *Git) Push(remote, branch string) (string, error)

Push pushes to the given remote and branch.

func (*Git) PushWithUpstream

func (g *Git) PushWithUpstream(remote, branch string) (string, error)

PushWithUpstream pushes and sets upstream tracking.

func (*Git) RemoteAdd

func (g *Git) RemoteAdd(name, url string) error

RemoteAdd adds a git remote.

func (*Git) RemoteList

func (g *Git) RemoteList() (string, error)

RemoteList returns the list of configured remotes.

func (*Git) RemoteRemove added in v0.4.0

func (g *Git) RemoteRemove(name string) error

RemoteRemove removes a git remote.

func (*Git) RemoteSetURL added in v0.4.0

func (g *Git) RemoteSetURL(name, url string) error

RemoteSetURL updates the URL of an existing git remote.

func (*Git) ShowFileAtRef

func (g *Git) ShowFileAtRef(ref, path string) (string, error)

ShowFileAtRef returns the contents of a file at a specific git ref.

Jump to

Keyboard shortcuts

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