Categorygithub.com/gogs/git-module
modulepackage
0.8.3
Repository: https://github.com/gogs/git-module.git
Documentation: pkg.go.dev

# README

Git Module

Build Status Sourcegraph

Package git-module is a Go module for Git access through shell commands.

Limitations

  • Go version must be at least 1.4.
  • Git version must be no less than 1.8.3.
  • For Windows users, try use as new a version as possible.

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.
AddRemote adds a new remote.
Version 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.
DeleteBranch deletes a branch from given repository path.
Fetch fetches changes from remotes without merging.
Fsck verifies the connectivity and validity of the objects in the database.
GetCommitFileStatus returns file status of commit in given repository.
GetDiffCommit returns a parsed diff object of given commit.
GetDiffRange returns a parsed diff object between given commits.
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.
GetLatestCommitDate returns the date of latest commit of repository.
GetRawDiff dumps diff results of repository in given commit ID to io.Writer.
GetRepoSize returns disk usage report of repository in given path.
InitRepository initializes a new Git repository.
IsBranchExist returns true if given branch exists in the repository.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
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.
No description provided by the author
NewID creates a new sha1 from a [20]byte array.
NewIDFromString creates a new sha1 from a ID string of length 40.
No description provided by the author
No description provided by the author
OpenRepository opens the repository at the given path.
ParsePatch takes a reader and parses everything it receives in diff format.
Pull pulls changes from remotes.
Push pushs local commits to given remote branch.
PushWithEnvs pushs local commits to given remote branch with given environment variables.
No description provided by the author
RemoveRemote removes a remote from given repository path if exists.
ResetHEAD resets HEAD to given revision or head of branch.
UnescapeChars reverses escaped characters.

# Constants

No description provided by the author
No description provided by the author
DEPRECATED: use BranchPrefix instead.
No description provided by the author
No description provided by the author
DEPRECATED: use DiffFileAdd instead.
DEPRECATED: use DiffFileChange instead.
DEPRECATED: use DiffFileDel instead.
DEPRECATED: use DiffFileRename instead.
DEPRECATED: use DiffLineAdd instead.
DEPRECATED: use DiffLineDel instead.
DEPRECATED: use DiffLinePlain instead.
DEPRECATED: use DiffLineSection instead.
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
DEPRECATED: use EmptySHA instead.
No description provided by the author
ENTRY_MODE_BLOB
DEPRECATED: use EntryBlob instead.
ENTRY_MODE_COMMIT
DEPRECATED: use EntryCommit instead.
ENTRY_MODE_EXEC
DEPRECATED: use EntryExec instead.
ENTRY_MODE_SYMLINK
DEPRECATED: use EntrySymlink instead.
ENTRY_MODE_TREE
DEPRECATED: use EntryTree instead.
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.
DEPRECATED: use ObjectBlob instead.
DEPRECATED: use ObjectCommit instead.
DEPRECATED: use ObjectTag instead.
DEPRECATED: use ObjectTree instead.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DEPRECATED: use RawDiffNormal instead.
DEPRECATED: use RawDiffPatch instead.
No description provided by the author
No description provided by the author
DEPRECATED: use RemotePrefix instead.
No description provided by the author
DEPRECATED: use TagPrefix instead.
No description provided by the author
DEPRECATED: use ArchiveTarGz instead.
DEPRECATED: use ArchiveZip instead.

# Variables

Debug enables verbose logging on everything.
No description provided by the author
No description provided by the author
Direcotry of hook and sample files.
HookNames is a list of Git server hooks' name that are supported.
No description provided by the author
No description provided by the author

# Structs

AddRemoteOptions contains options to add a remote address.
Blob represents a Git object.
Branch represents a Git branch.
No description provided by the author
No description provided by the author
Command represents a command with its subcommands or arguments.
Commit represents a git commit.
No description provided by the author
CommitFileStatus represents status of files in a commit.
CountObject represents disk usage report of Git repository.
Option(s) for delete branch.
Diff contains all information of a specific diff output.
DiffFile represents a file in diff.
DiffLine represents a line in diff.
DiffSection represents a section in diff.
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
Hook represents a Git hook.
No description provided by the author
No description provided by the author
PullRequestInfo represents needed information for a pull request.
Repository represents a Git repository.
Signature represents the Author or Committer information.
No description provided by the author
SubModuleFile represents a file with submodule type.
Tag represents a Git tag.
No description provided by the author
Tree represents a flat directory listing.
No description provided by the author

# Type aliases

No description provided by the author
DiffFileType represents the file status in diff.
DiffLineType represents the type of a line in diff.
No description provided by the author
No description provided by the author
No description provided by the author
RawDiffType represents the type of raw diff format.