# README
Git Module
Package git-module is a Go module for Git access through shell commands.
Requirements
- Go version must be at least 1.17.
- Git version must be no less than 1.8.3.
- For Windows users, try to use the latest version of both.
License
This project is under the MIT License. See the LICENSE file for the full license text.
# Functions
Add adds local changes to index for the repository in given path.
BinVersion returns current Git binary version that is used by this module.
Checkout checks out to given branch for the repository in given path.
Clone clones the repository from remote URL to the destination.
CountObjects returns disk usage report of the repository in given path.
CreateCommit commits local changes with given author, committer and message for the repository in given path.
DeleteBranch deletes the branch from the repository in given path.
DiffNameOnly returns a list of changed files between base and head revisions of the repository in given path.
Fsck verifies the connectivity and validity of the objects in the database for the repository in given path.
HasTag returns true if given tag exists in the repository in given path.
Init initializes a new Git repository.
IsURLAccessible returns true if given remote URL is accessible via Git within given timeout.
Log returns a list of commits in the state of given revision of the repository in given path.
LsRemote returns a list references in the remote repository.
MergeBase returns merge base between base and head revisions of the repository in given path.
Move moves a file, a directory, or a symlink file or directory from source to destination for the repository in given path.
MustID always returns a new SHA1 from a [20]byte array with no validation of input.
MustIDFromString always returns a new sha from a ID with no validation of input.
NewCommand creates and returns a new Command with given arguments for "git".
NewCommandWithContext creates and returns a new Command with given arguments and context for "git".
NewID returns a new SHA1 from a [20]byte array.
NewIDFromString returns a new SHA1 from a ID string of length 40.
Open opens the repository at the given path.
Push pushes local changes to given remote and branch for the repository in given path.
ReceivePack receives what is pushed into the repository in given path.
RefShortName returns short name of heads or tags.
RemoteAdd adds a new remote to the repository in given path.
RemoteGetURL retrieves URL(s) of a remote of the repository in given path.
RemoteRemove removes a remote from the repository in given path.
Remotes lists remotes of the repository in given path.
RemoteSetURL sets first URL of the remote with given name of the repository in given path.
RemoteSetURLAdd appends an URL to the remote with given name of the repository in given path.
RemoteSetURLDelete deletes the remote with given name of the repository in given path.
Deprecated: Use Add instead.
Deprecated: Use RemoteAdd instead.
Deprecated: Use Checkout instead.
Deprecated: Use CreateCommit instead.
Deprecated: Use CountObjects instead.
Deprecated: Use DeleteBranch instead.
Deprecated: Use DiffNameOnly instead.
Deprecated: Use Fsck instead.
RepoHasBranch returns true if given branch exists in the repository in given path.
RepoHasReference returns true if given reference exists in the repository in given path.
Deprecated: Use HasTag instead.
Deprecated: Use Log instead.
Deprecated: Use MergeBase instead.
Deprecated: Use Move instead.
Deprecated: Use Push instead.
Deprecated: Use RemoteRemove instead.
Deprecated: Use Reset instead.
Deprecated: Use ShowNameStatus instead.
Deprecated: Use ShowRefVerify instead.
RepoTags returns a list of tags of the repository in given path.
Reset resets working tree to given revision for the repository in given path.
SetOutput sets the output writer for logs.
SetPrefix sets the prefix to be prepended to each log entry.
ShowNameStatus returns name status of given revision of the repository in given path.
ShowRefVerify returns the commit ID of given reference if it exists in the repository in given path.
StreamParseDiff parses the diff read from the given io.Reader.
SymbolicRef returns the reference name (e.g.
UnescapeChars reverses escaped characters.
UpdateServerInfo updates the auxiliary info file on the server side for the repository in given path.
UploadPack sends the packfile to the client for the repository in given path.
# Constants
A list of formats can be created by Git for an archive.
A list of formats can be created by Git for an archive.
DefaultHooksDir is the default directory for Git hooks.
DefaultTimeout is the default timeout duration for all commands.
A list of different file statuses.
A list of different file statuses.
A list of different file statuses.
A list of different file statuses.
A list of different line types.
A list of different line types.
A list of different line types.
A list of different line types.
EmptyID is an ID with empty SHA-1 hash.
There are only a few file modes in Git.
There are only a few file modes in Git.
There are only a few file modes in Git.
There are only a few file modes in Git.
There are only a few file modes in Git.
A list of Git server hooks' name that are supported.
A list of Git server hooks' name that are supported.
A list of Git server hooks' name that are supported.
No description provided by the author
A list of object types.
A list of object types.
A list of object types.
A list of object types.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ServerSideHooks contains a list of Git hooks that are supported on the server side.
ServerSideHookSamples contains samples of Git hooks that are supported on the server side.
# Structs
AddOptions contains optional arguments for adding local changes.
Blame contains information of a Git file blame.
BlameOptions contains optional arguments for blaming a file.
Blob is a blob object.
CatFileBlobOptions contains optional arguments for verifying the objects.
CatFileCommitOptions contains optional arguments for verifying the objects.
CatFileTypeOptions contains optional arguments for showing the object type.
CheckoutOptions contains optional arguments for checking out to a branch.
CloneOptions contains optional arguments for cloning a repository.
Command contains the name, arguments and environment variables of a command.
CommandOptions contains options for running a command.
Commit contains information of a Git commit.
CommitByRevisionOptions contains optional arguments for getting a commit.
CommitOptions contains optional arguments to commit changes.
CommitsByPageOptions contains optional arguments for getting paginated commits.
CommitsInfoOptions contains optional arguments for getting commits information.
CommitsSinceOptions contains optional arguments for listing commits since a time.
CountObject contains disk usage report of a repository.
CountObjectsOptions contains optional arguments for counting objects.
CreateTagOptions contains optional arguments for creating a tag.
DeleteBranchOptions contains optional arguments for deleting a branch.
DeleteTagOptions contains optional arguments for deleting a tag.
Diff represents a Git diff.
DiffBinaryOptions contains optional arguments for producing binary patch.
DiffFile represents a file in diff.
DiffLine represents a line in diff.
DiffNameOnlyOptions contains optional arguments for listing changed files.
DiffOptions contains optional arguments for parsing diff.
DiffSection represents a section in diff.
EntryCommitInfo contains a tree entry with its commit information.
FetchOptions contains optional arguments for fetching repository updates.
FsckOptions contains optional arguments for verifying the objects.
GrepOptions contains optional arguments for grep search over repository files.
GrepResult represents a single result from a grep search.
Hook contains information of a Git hook.
InitOptions contains optional arguments for initializing a repository.
LatestCommitTimeOptions contains optional arguments for getting the latest commit time.
LogOptions contains optional arguments for listing commits.
LsRemoteOptions contains arguments for listing references in a remote repository.
LsTreeOptions contains optional arguments for listing trees.
MergeBaseOptions contains optional arguments for getting merge base.
MoveOptions contains optional arguments for moving a file, a directory, or a symlink.
NameStatus contains name status of a commit.
PullOptions contains optional arguments for pulling repository updates.
PushOptions contains optional arguments for pushing repository changes.
RawDiffOptions contains optional arguments for dumping a raw diff.
ReceivePackOptions contains optional arguments for receiving the info pushed to the repository.
Reference contains information of a Git reference.
RemoteAddOptions contains options to add a remote address.
RemoteGetURLOptions contains arguments for retrieving URL(s) of a remote of the repository.
RemoteRemoveOptions contains arguments for removing a remote from the repository.
RemoteSetURLAddOptions contains arguments for appending an URL to a remote of the repository.
RemoteSetURLDeleteOptions contains arguments for deleting an URL of a remote of the repository.
RemoteSetURLOptions contains arguments for setting an URL of a remote of the repository.
RemotesOptions contains arguments for listing remotes of the repository.
Repository contains information of a Git repository.
ResetOptions contains optional arguments for resetting a branch.
RevListCountOptions contains optional arguments for counting commits.
RevListOptions contains optional arguments for listing commits.
RevParseOptions contains optional arguments for parsing revision.
RunInDirOptions contains options for running a command in a directory.
SearchCommitsOptions contains optional arguments for searching commits.
SHA1 is the SHA-1 hash of a Git object.
ShowNameStatusOptions contains optional arguments for showing name status.
ShowRefOptions contains optional arguments for listing references.
ShowRefVerifyOptions contains optional arguments for verifying a reference.
Signature represents a author or committer.
SteamParseDiffResult contains results of streaming parsing a diff.
Submodule contains information of a Git submodule.
SymbolicRefOptions contains optional arguments for get and set symbolic ref.
Tag contains information of a Git tag.
TagOptions contains optional arguments for getting a tag.
TagsOptions contains optional arguments for listing tags.
Tree represents a flat directory listing in Git.
No description provided by the author
UpdateServerInfoOptions contains optional arguments for updating auxiliary info file on the server side.
UploadPackOptions contains optional arguments for sending the packfile to the client.
# Type aliases
Deprecated: Use RemoteAddOptions instead.
ArchiveFormat is the format of an archive.
DiffFileType is the file status in diff.
DiffLineType is the line type in diff.
Entries is a sortable list of tree entries.
EntryMode is the unix file mode of a tree entry.
HookName is the name of a Git hook.
ObjectType is the type of a Git objet.
RawDiffFormat is the format of a raw diff.
Deprecated: Use RemoteRemoveOptions instead.