Documentation
¶
Index ¶
- func Checkout(repoPath string, branchName string) error
- func CommitFile(repoPath string, filePath string, message string) error
- func CreateBranch(path string, branchName string) error
- func GetHeadID(repoPath string) (string, error)
- func InitRepo(path string, remoteURL string) error
- func IsDirty(repoPath string, targetPath string) (bool, error)
- func Pull(repoPath string) error
- func Push(repoPath string) error
- func Remove(repoPath string, filePath string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Checkout ¶
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 ¶
CommitFile stages a specific file and commits it with the message.
func CreateBranch ¶
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 ¶
GetHeadID returns the SCADUFAX_ID from the HEAD commit message. Returns empty string if not found.
func InitRepo ¶
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 ¶
IsDirty checks if the given path (or worktree if path is ".") has uncommitted changes.
Types ¶
This section is empty.