Categorygithub.com/go-gitea/git
modulepackage
0.0.0-20190411170847-63b74d438b29
Repository: https://github.com/go-gitea/git.git
Documentation: pkg.go.dev

# README

Git Shell

Build Status Join the chat at https://img.shields.io/discord/322538954119184384.svg codecov Go Report Card GoDoc

This project is a Go module to access Git through shell commands. For further informations take a look at the current documentation.

Contributing

Fork -> Patch -> Push -> Pull Request

Authors

License

This project is under the MIT License. See the LICENSE file for the full license text.

# Functions

AddChanges marks local changes to be ready for commit.
BinVersion returns current Git version from shell.
Checkout checkouts a branch.
Clone clones original repository to target path.
CommitChanges commits local changes with given committer, author and message.
CommitsCount returns number of total commits of until given revision.
Fsck verifies the connectivity and validity of the objects in the database.
GetCommitFileStatus returns file status of commit in given repository.
GetFullCommitID returns full length (40) of commit ID by given short SHA in a repository.
GetHook returns a Git hook by given name and repository.
GetLatestCommitTime returns time for latest commit in repository (across all branches).
GetRepoSize returns disk consumption for repo in path.
InitRepository initializes a new Git repository.
IsBranchExist returns true if given branch exists in the repository.
IsErrExecTimeout if some error is ErrExecTimeout.
IsErrNotExist if some error is ErrNotExist.
IsErrUnsupportedVersion if some error is ErrUnsupportedVersion.
IsReferenceExist returns true if given reference exists in the repository.
IsRepoURLAccessible checks if given repository URL is accessible.
IsTagExist returns true if given tag exists in the repository.
IsValidHookName returns true if given name is a valid Git hook.
ListHooks returns a list of Git hooks of given repository.
MoveFile moves a file to another file or directory.
MustID always creates a new SHA1 from a [20]byte array with no validation of input.
MustIDFromString always creates a new sha from a ID with no validation of input.
NewCommand creates and returns a new Git Command based on given command and arguments.
NewCommitFileStatus creates a CommitFileStatus.
NewID creates a new SHA1 from a [20]byte array.
NewIDFromString creates a new SHA1 from a ID string of length 40.
NewSubModuleFile create a new submodule file.
NewTree create a new tree according the repository and commit id.
OpenRepository opens the repository at the given path.
ParseTreeEntries parses the output of a `git ls-tree` command.
Pull pulls changes from remotes.
Push pushs local commits to given remote branch.
RefEndName return the end name of a ref name.
ResetHEAD resets HEAD to given revision or head of branch.
SetUpdateHook writes given content to update hook of the reposiotry.
Version return this package's current version.

# Constants

BranchPrefix base dir of the branch information file store on git.
EmptySHA defines empty git SHA.
EntryModeBlob.
EntryModeCommit.
EntryModeExec.
EntryModeSymlink.
EntryModeTree.
GitTimeLayout is the (default) time layout used by git.
HookPathUpdate hook update path.
ObjectBlob blob object type.
ObjectCommit commit object type.
ObjectTag tag object type.
ObjectTree tree object type.
TagPrefix tags prefix path on the repository.
TARGZ tar gz archive type.
ZIP zip archive type.

# Variables

CommitsRangeSize the default commits range size.
Debug enables verbose logging on everything.
DefaultCommandExecutionTimeout default command execution timeout duration.
ErrNotValidHook error when a git hook is not valid.
GitVersionRequired is the minimum Git version required.
GlobalCommandArgs global command args for external package setting.
Prefix the log prefix.

# Structs

Blob represents a Git object.
Branch represents a Git branch.
CheckoutOptions options when heck out some branch.
CloneRepoOptions options when clone a repository.
Command represents a command with its subcommands or arguments.
Commit represents a git commit.
CommitChangesOptions the options when a commit created.
CommitFileStatus represents status of files in a commit.
CommitGPGSignature represents a git commit signature part.
CountObject represents repository count objects report.
DeleteBranchOptions Option(s) for delete branch.
ErrBadLink entry.FollowLink error.
ErrExecTimeout error when exec timed out.
ErrNotExist commit not exist error.
ErrUnsupportedVersion error when required git version not matched.
Hook represents a Git hook.
ObjectCache provides thread-safe cache opeations.
PullRemoteOptions options when pull from remote.
PullRequestInfo represents needed information for a pull request.
PushOptions options when push to remote.
Reference represents a Git ref.
Repository represents a Git repository.
Signature represents the Author or Committer information.
SubModule submodule is a reference on git repository.
SubModuleFile represents a file with submodule type.
Tag represents a Git tag.
Tree represents a flat directory listing.
TreeEntry the leaf in the git tree.

# Interfaces

LastCommitCache cache.

# Type aliases

ArchiveType archive types.
Entries a list of entry.
EntryMode the type of the object in the git tree.
ObjectType git object type.
SHA1 a git commit name.