gitops

package
v0.0.0-...-ed6f3f7 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Checkout

func Checkout(repoPath string, branchName string) error

Checkout switches the repo to the specified branch. It tries to find local branch, if not found tries to find remote branch and create local tracking branch.

func CommitFile

func CommitFile(repoPath string, filePath string, message string) error

CommitFile stages a specific file and commits it with the message.

func CreateBranch

func CreateBranch(path string, branchName string) error

CreateBranch creates a new branch with the given name pointing to HEAD. If the branch already exists, it does nothing and returns nil.

func GetHeadID

func GetHeadID(repoPath string) (string, error)

GetHeadID returns the SCADUFAX_ID from the HEAD commit message. Returns empty string if not found.

func InitRepo

func InitRepo(path string, remoteURL string) error

InitRepo initializes a new git repository at the given path, adds a remote, and pulls the main branch. It assumes the directory exists (or allows go-git to create it).

func IsDirty

func IsDirty(repoPath string, targetPath string) (bool, error)

IsDirty checks if the given path (or worktree if path is ".") has uncommitted changes.

func Pull

func Pull(repoPath string) error

Pull updates the current branch from its upstream (assumed origin).

func Push

func Push(repoPath string) error

Push pushes the current branch to origin.

func Remove

func Remove(repoPath string, filePath string) error

Remove deletes a file from the worktree. It does NOT commit the deletion. Use CommitFile for that.

Types

This section is empty.

Jump to

Keyboard shortcuts

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