{"modulePath":"github.com/gitopia/gitopia-mcp-server","version":"v0.1.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package git\n\n## Functions\n\n```go\nfunc NormalizeGitopiaURL(url string) string\n```\nNormalizeGitopiaURL converts various Gitopia URL formats to the canonical gitopia:// format\n\n```go\nfunc SetupGitConfig(ctx context.Context, name, email string) error\n```\nSetupGitConfig sets the global git user name and email.\n\n```go\nfunc ValidateGitopiaURL(url string) bool\n```\nValidateGitopiaURL checks if a URL is a valid Gitopia URL\n\n## Types\n\n```go\ntype AuthManager struct {\n\tWalletPath string\n}\n```\nAuthManager handles git authentication for Gitopia\n\n```go\nfunc NewAuthManager() *AuthManager\n```\nNewAuthManager creates a new authentication manager\n\n```go\nfunc (am *AuthManager) CleanupAuth() error\n```\nCleanupAuth removes the temporary wallet file and unsets environment variables\n\n```go\nfunc (am *AuthManager) GetWalletPath() string\n```\nGetWalletPath returns the current wallet path\n\n```go\nfunc (am *AuthManager) IsAuthSetup() bool\n```\nIsAuthSetup checks if git authentication is properly configured\n\n```go\nfunc (am *AuthManager) SetupAuth(walletData []byte, walletAddress string) error\n```\nSetupAuth sets up git authentication using a wallet\n\n```go\ntype BranchOption func(*BranchOptions)\n```\n\n```go\nfunc WithStartPoint(startPoint string) BranchOption\n```\n\n```go\ntype BranchOptions struct {\n\tStartPoint string\n}\n```\nBranchOptions contains options for creating branches\n\n```go\ntype CheckoutOption func(*CheckoutOptions)\n```\n\n```go\nfunc WithCreateBranch(createBranch bool) CheckoutOption\n```\n\n```go\nfunc WithForceCheckout(force bool) CheckoutOption\n```\n\n```go\ntype CheckoutOptions struct {\n\tCreateBranch bool\n\tForce        bool\n}\n```\nCheckoutOptions contains options for checkout\n\n```go\ntype Client struct {\n\t// GitPath is the path to the git executable (default: \"git\")\n\tGitPath string\n\t// Timeout for git operations (default: 30 seconds)\n\tTimeout time.Duration\n}\n```\nClient wraps git CLI operations\n\n```go\nfunc NewClient() *Client\n```\nNewClient creates a new git client\n\n```go\nfunc (c *Client) Add(ctx context.Context, repoPath string, files ...string) error\n```\nAdd stages files for commit\n\n```go\nfunc (c *Client) Checkout(ctx context.Context, repoPath, branchOrCommit string, options ...CheckoutOption) error\n```\nCheckout switches branches or restores files\n\n```go\nfunc (c *Client) Clone(ctx context.Context, url, path string, options ...CloneOption) error\n```\nClone clones a repository\n\n```go\nfunc (c *Client) Commit(ctx context.Context, repoPath, message string, options ...CommitOption) (string, error)\n```\nCommit creates a new commit\n\n```go\nfunc (c *Client) CreateBranch(ctx context.Context, repoPath, branchName string, options ...BranchOption) error\n```\nCreateBranch creates a new branch\n\n```go\nfunc (c *Client) GetCurrentBranch(ctx context.Context, repoPath string) (string, error)\n```\nGetCurrentBranch returns the current branch name\n\n```go\nfunc (c *Client) GetRemoteURL(ctx context.Context, repoPath, remote string) (string, error)\n```\nGetRemoteURL returns the URL of the specified remote\n\n```go\nfunc (c *Client) Init(ctx context.Context, path, remoteURL string) error\n```\nInit initializes a new git repository in the given path. If remoteURL is provided, it adds it as the 'origin' remote.\n\n```go\nfunc (c *Client) IsRepository(path string) bool\n```\nIsRepository checks if the given path is a git repository\n\n```go\nfunc (c *Client) Pull(ctx context.Context, repoPath string, options ...PullOption) error\n```\nPull fetches and merges from remote\n\n```go\nfunc (c *Client) Push(ctx context.Context, repoPath string, options ...PushOption) error\n```\nPush pushes commits to remote\n\n```go\nfunc (c *Client) Status(ctx context.Context, repoPath string) (*Status, error)\n```\nStatus returns the repository status\n\n```go\ntype CloneOption func(*CloneOptions)\n```\n\n```go\nfunc WithBranch(branch string) CloneOption\n```\n\n```go\nfunc WithDepth(depth int) CloneOption\n```\n\n```go\nfunc WithQuiet(quiet bool) CloneOption\n```\n\n```go\ntype CloneOptions struct {\n\tBranch string\n\tDepth  int\n\tQuiet  bool\n}\n```\nCloneOptions contains options for cloning repositories\n\n```go\ntype CommitOption func(*CommitOptions)\n```\n\n```go\nfunc WithAllowEmpty(allowEmpty bool) CommitOption\n```\n\n```go\nfunc WithAmend(amend bool) CommitOption\n```\n\n```go\nfunc WithAuthor(author string) CommitOption\n```\n\n```go\ntype CommitOptions struct {\n\tAuthor     string\n\tAllowEmpty bool\n\tAmend      bool\n}\n```\nCommitOptions contains options for committing\n\n```go\ntype FileChange struct {\n\tPath    string `json:\"path\"`\n\tContent string `json:\"content,omitempty\"`\n\tMode    string `json:\"mode\"` // \"create\", \"modify\", \"delete\"\n}\n```\nFileChange represents a file change for batch operations\n\n```go\ntype GitError struct {\n\tCommand  string\n\tArgs     []string\n\tExitCode int\n\tStdout   string\n\tStderr   string\n\tErr      error\n}\n```\nGitError represents a git command error with detailed information\n\n```go\nfunc (e *GitError) Error() string\n```\n\n```go\nfunc (e *GitError) UserFriendlyMessage() string\n```\nUserFriendlyMessage returns a user-friendly error message\n\n```go\ntype PullOption func(*PullOptions)\n```\n\n```go\nfunc WithBranchToPull(branch string) PullOption\n```\n\n```go\nfunc WithFFOnly(ffOnly bool) PullOption\n```\n\n```go\nfunc WithRebase(rebase bool) PullOption\n```\n\n```go\nfunc WithRemoteToPull(remote string) PullOption\n```\n\n```go\ntype PullOptions struct {\n\tRemote string\n\tBranch string\n\tRebase bool\n\tFFOnly bool\n}\n```\nPullOptions contains options for pulling\n\n```go\ntype PushOption func(*PushOptions)\n```\n\n```go\nfunc WithBranchToPush(branch string) PushOption\n```\n\n```go\nfunc WithDelete(delete bool) PushOption\n```\n\n```go\nfunc WithDryRun(dryRun bool) PushOption\n```\n\n```go\nfunc WithForce(force bool) PushOption\n```\n\n```go\nfunc WithForceWithLease(forceWithLease bool) PushOption\n```\n\n```go\nfunc WithRemote(remote string) PushOption\n```\n\n```go\nfunc WithSetUpstream(setUpstream bool) PushOption\n```\n\n```go\nfunc WithTags(tags bool) PushOption\n```\n\n```go\ntype PushOptions struct {\n\tRemote         string\n\tBranch         string\n\tSetUpstream    bool\n\tForce          bool\n\tForceWithLease bool\n\tDryRun         bool\n\tTags           bool\n\tDelete         bool\n}\n```\nPushOptions contains options for pushing\n\n```go\ntype Status struct {\n\tBranch        string   `json:\"branch\"`\n\tStaged        []string `json:\"staged\"`\n\tModified      []string `json:\"modified\"`\n\tUntracked     []string `json:\"untracked\"`\n\tCommitsAhead  int      `json:\"commits_ahead\"`\n\tCommitsBehind int      `json:\"commits_behind\"`\n\tClean         bool     `json:\"clean\"`\n}\n```\nStatus represents the status of a git repository\n\n```go\nfunc (s *Status) HasChanges() bool\n```\nHasChanges returns true if there are any changes (staged or unstaged)\n\n```go\nfunc (s *Status) IsClean() bool\n```\nIsClean returns true if the working tree is clean\n\n```go\ntype WorkflowResult struct {\n\tSuccess      bool              `json:\"success\"`\n\tMessage      string            `json:\"message\"`\n\tBranch       string            `json:\"branch,omitempty\"`\n\tCommitHash   string            `json:\"commit_hash,omitempty\"`\n\tFilesChanged int               `json:\"files_changed,omitempty\"`\n\tPRURL        string            `json:\"pr_url,omitempty\"`\n\tPRNumber     int               `json:\"pr_number,omitempty\"`\n\tErrors       []string          `json:\"errors,omitempty\"`\n\tMetadata     map[string]string `json:\"metadata,omitempty\"`\n}\n```\nWorkflowResult represents the result of a high-level git workflow operation\n\n","path":"github.com/gitopia/gitopia-mcp-server/internal/git","name":"git","synopsis":"","isRedistributable":true}
