xgit

package
v28.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreChangesCommitted

func AreChangesCommitted(dir string) (bool, error)

AreChangesCommitted returns true if dir is a clean git repository with no pending changes. It returns also true if dir is NOT a git repository.

func Clone

func Clone(ctx context.Context, urlRef, dir string) error

Clone clones a git repository represented by urlRef, into dir. urlRef is the URL of the repository, with an optional ref, suffixed to the URL with a `@`. Ref can be a tag, a branch or a hash. Valid examples of urlRef: github.com/org/repo, github.com/org/repo@v1, github.com/org/repo@develop, github.com/org/repo@ab88cdf.

func InitAndCommit

func InitAndCommit(path string) error

InitAndCommit creates a git repo in path if path isn't already inside a git repository, then commits path content.

func IsRepository

func IsRepository(path string) (bool, error)

IsRepository checks if a path contains a Git repository.

func RepositoryURL added in v28.7.0

func RepositoryURL(path string) (string, error)

RepositoryURL returns the URL of the origin remote of a Git repository.

Types

This section is empty.

Jump to

Keyboard shortcuts

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