{"modulePath":"github.com/keysolutions/git-town","version":"v5.0.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package git\n\n## Functions\n\n```go\nfunc AddToPerennialBranches(branchName string)\n```\nAddToPerennialBranches adds the given branch as a perennial branch\n\n```go\nfunc CommentOutSquashCommitMessage(prefix string)\n```\nCommentOutSquashCommitMessage comments out the message for the current squash merge Adds the given prefix with the newline if provided\n\n```go\nfunc CompileAncestorBranches(branchName string) (result []string)\n```\nCompileAncestorBranches calculates and returns the list of ancestor branches of the given branch based off the \"git-town-branch.XXX.parent\" configuration values.\n\n```go\nfunc DeleteAllAncestorBranches()\n```\nDeleteAllAncestorBranches removes all Git Town ancestor entries for all branches from the configuration.\n\n```go\nfunc DeleteParentBranch(branchName string)\n```\nDeleteParentBranch removes the parent branch entry for the given branch from the Git configuration.\n\n```go\nfunc DoesBranchHaveUnmergedCommits(branchName string) bool\n```\nDoesBranchHaveUnmergedCommits returns whether the branch with the given name contains commits that are not merged into the main branch\n\n```go\nfunc EnsureBranchInSync(branchName, errorMessageSuffix string)\n```\nEnsureBranchInSync enforces that a branch with the given name is in sync with its tracking branch\n\n```go\nfunc EnsureDoesNotHaveBranch(branchName string)\n```\nEnsureDoesNotHaveBranch enforces that a branch with the given name does not exist\n\n```go\nfunc EnsureDoesNotHaveConflicts()\n```\nEnsureDoesNotHaveConflicts asserts that the workspace has no unresolved merge conflicts.\n\n```go\nfunc EnsureDoesNotHaveOpenChanges(message string)\n```\nEnsureDoesNotHaveOpenChanges assets that the workspace has no open changes\n\n```go\nfunc EnsureHasBranch(branchName string)\n```\nEnsureHasBranch enforces that a branch with the given name exists\n\n```go\nfunc EnsureIsFeatureBranch(branchName, errorSuffix string)\n```\nEnsureIsFeatureBranch asserts that the given branch is a feature branch.\n\n```go\nfunc EnsureIsNotMainBranch(branchName, errorMessage string)\n```\nEnsureIsNotMainBranch enforces that a branch with the given name is not the main branch\n\n```go\nfunc EnsureIsNotPerennialBranch(branchName, errorMessage string)\n```\nEnsureIsNotPerennialBranch enforces that a branch with the given name is not a perennial branch\n\n```go\nfunc EnsureIsPerennialBranch(branchName, errorMessage string)\n```\nEnsureIsPerennialBranch enforces that a branch with the given name is a perennial branch\n\n```go\nfunc EnsureVersionRequirementSatisfied()\n```\nEnsureVersionRequirementSatisfied asserts that Git is the needed version or higher\n\n```go\nfunc GetAncestorBranches(branchName string) []string\n```\nGetAncestorBranches returns the names of all parent branches for the given branch, beginning but not including the parennial branch from which this hierarchy was cut. This information is read from the cache in the Git config, so might be out of date when the branch hierarchy has been modified.\n\n```go\nfunc GetBranchSha(branchName string) string\n```\nGetBranchSha returns the SHA1 of the latest commit on the branch with the given name.\n\n```go\nfunc GetChildBranches(branchName string) (result []string)\n```\nGetChildBranches returns the names of all branches for which the given branch is a parent.\n\n```go\nfunc GetConfigurationValue(key string) (result string)\n```\nGetConfigurationValue returns the given configuration value, from either global or local Git configuration\n\n```go\nfunc GetCurrentBranchName() string\n```\nGetCurrentBranchName returns the name of the currently checked out branch\n\n```go\nfunc GetCurrentSha() string\n```\nGetCurrentSha returns the SHA of the currently checked out commit.\n\n```go\nfunc GetExpectedPreviouslyCheckedOutBranch(initialPreviouslyCheckedOutBranch, initialBranch string) string\n```\nGetExpectedPreviouslyCheckedOutBranch returns what is the expected previously checked out branch given the inputs\n\n```go\nfunc GetGlobalConfigurationValue(key string) (result string)\n```\nGetGlobalConfigurationValue returns the global git configuration value for the given key\n\n```go\nfunc GetLastCommitMessage() string\n```\nGetLastCommitMessage returns the commit message for the last commit\n\n```go\nfunc GetLocalAuthor() string\n```\nGetLocalAuthor returns the locally Git configured user\n\n```go\nfunc GetLocalBranches() (result []string)\n```\nGetLocalBranches returns the names of all branches in the local repository, ordered alphabetically\n\n```go\nfunc GetLocalBranchesWithDeletedTrackingBranches() (result []string)\n```\nGetLocalBranchesWithDeletedTrackingBranches returns the names of all branches whose remote tracking branches have been deleted\n\n```go\nfunc GetLocalBranchesWithMainBranchFirst() (result []string)\n```\nGetLocalBranchesWithMainBranchFirst returns the names of all branches that exist in the local repository, ordered to have the name of the main branch first, then the names of the branches, ordered alphabetically\n\n```go\nfunc GetMainBranch() string\n```\nGetMainBranch returns the name of the main branch.\n\n```go\nfunc GetParentBranch(branchName string) string\n```\nGetParentBranch returns the name of the parent branch of the given branch.\n\n```go\nfunc GetPerennialBranches() []string\n```\nGetPerennialBranches returns all branches that are marked as perennial.\n\n```go\nfunc GetPreviouslyCheckedOutBranch() string\n```\nGetPreviouslyCheckedOutBranch returns the name of the previously checked out branch\n\n```go\nfunc GetPrintableBranchTree(branchName string) (result string)\n```\nGetPrintableBranchTree returns a user printable branch tree\n\n```go\nfunc GetPrintableHackPushFlag() string\n```\nGetPrintableHackPushFlag returns a user printable hack push flag\n\n```go\nfunc GetPrintableMainBranch() string\n```\nGetPrintableMainBranch returns a user printable main branch\n\n```go\nfunc GetPrintableOfflineFlag() string\n```\nGetPrintableOfflineFlag returns a user printable offline flag\n\n```go\nfunc GetPrintablePerennialBranches() string\n```\nGetPrintablePerennialBranches returns a user printable list of perennial branches\n\n```go\nfunc GetPullBranchStrategy() string\n```\nGetPullBranchStrategy returns the currently configured pull branch strategy.\n\n```go\nfunc GetRemoteOriginURL() string\n```\nGetRemoteOriginURL returns the URL for the \"origin\" remote. In tests this value can be stubbed.\n\n```go\nfunc GetRemoteUpstreamURL() string\n```\nGetRemoteUpstreamURL returns the URL of the \"upstream\" remote.\n\n```go\nfunc GetRootDirectory() string\n```\nGetRootDirectory returns the path of the rood directory of the current repository, i.e. the directory that contains the \".git\" folder.\n\n```go\nfunc GetTrackingBranchName(branchName string) string\n```\nGetTrackingBranchName returns the name of the remote branch that corresponds to the local branch with the given name\n\n```go\nfunc GetURLHostname(url string) string\n```\nGetURLHostname returns the hostname contained within the given Git URL.\n\n```go\nfunc GetURLRepositoryName(url string) string\n```\nGetURLRepositoryName returns the repository name contains within the given Git URL.\n\n```go\nfunc HasBranch(branchName string) bool\n```\nHasBranch returns whether the repository contains a branch with the given name. The branch does not have to be present on the local repository.\n\n```go\nfunc HasCompiledAncestorBranches(branchName string) bool\n```\nHasCompiledAncestorBranches returns whether the Git Town configuration contains a cached ancestor list for the branch with the given name.\n\n```go\nfunc HasConflicts() bool\n```\nHasConflicts returns whether the local repository currently has unresolved merge conflicts.\n\n```go\nfunc HasGlobalConfigurationValue(key string) bool\n```\nHasGlobalConfigurationValue returns whether there is a global git configuration for the given key\n\n```go\nfunc HasLocalBranch(branchName string) bool\n```\nHasLocalBranch returns whether the local repository contains a branch with the given name.\n\n```go\nfunc HasOpenChanges() bool\n```\nHasOpenChanges returns whether the local repository contains uncommitted changes.\n\n```go\nfunc HasRemote(name string) bool\n```\nHasRemote returns whether the current repository contains a Git remote with the given name.\n\n```go\nfunc HasShippableChanges(branchName string) bool\n```\nHasShippableChanges returns whether the supplied branch has an changes not currently on the main branchName\n\n```go\nfunc HasTrackingBranch(branchName string) bool\n```\nHasTrackingBranch returns whether the local branch with the given name has a tracking branch.\n\n```go\nfunc IsAncestorBranch(branchName, ancestorBranchName string) bool\n```\nIsAncestorBranch returns whether the given branch is an ancestor of the other given branch.\n\n```go\nfunc IsBranchInSync(branchName string) bool\n```\nIsBranchInSync returns whether the branch with the given name is in sync with its tracking branch\n\n```go\nfunc IsFeatureBranch(branchName string) bool\n```\nIsFeatureBranch returns whether the branch with the given name is a feature branch.\n\n```go\nfunc IsMainBranch(branchName string) bool\n```\nIsMainBranch returns whether the branch with the given name is the main branch of the repository.\n\n```go\nfunc IsMergeInProgress() bool\n```\nIsMergeInProgress returns whether the local repository is in the middle of an unfinished merge process.\n\n```go\nfunc IsOffline() bool\n```\nIsOffline returns whether Git Town is currently in offline mode\n\n```go\nfunc IsPerennialBranch(branchName string) bool\n```\nIsPerennialBranch returns whether the branch with the given name is a perennial branch.\n\n```go\nfunc IsRebaseInProgress() bool\n```\nIsRebaseInProgress returns whether the local repository is in the middle of an unfinished rebase process.\n\n```go\nfunc IsRepository() bool\n```\nIsRepository returns whether or not the current directory is in a repository\n\n```go\nfunc RemoveAllConfiguration()\n```\nRemoveAllConfiguration removes all Git Town configuration\n\n```go\nfunc RemoveFromPerennialBranches(branchName string)\n```\nRemoveFromPerennialBranches removes the given branch as a perennial branch\n\n```go\nfunc SetAncestorBranches(branchName string, ancestorBranches []string)\n```\nSetAncestorBranches stores the given list of branches as ancestors for the given branch in the Git Town configuration.\n\n```go\nfunc SetMainBranch(branchName string)\n```\nSetMainBranch marks the given branch as the main branch in the Git Town configuration.\n\n```go\nfunc SetParentBranch(branchName, parentBranchName string)\n```\nSetParentBranch marks the given branch as the direct parent of the other given branch in the Git Town configuration.\n\n```go\nfunc SetPerennialBranches(branchNames []string)\n```\nSetPerennialBranches marks the given branches as perennial branches\n\n```go\nfunc SetPullBranchStrategy(strategy string)\n```\nSetPullBranchStrategy updates the configured pull branch strategy.\n\n```go\nfunc ShouldBranchBePushed(branchName string) bool\n```\nShouldBranchBePushed returns whether the local branch with the given name contains commits that have not been pushed to the remote.\n\n```go\nfunc ShouldHackPush() bool\n```\nShouldHackPush returns whether the current repository is configured to push freshly created branches up to the origin remote.\n\n```go\nfunc UpdateOffline(value bool)\n```\nUpdateOffline updates whether Git Town is in offline mode\n\n```go\nfunc UpdateShouldHackPush(value bool)\n```\nUpdateShouldHackPush updates whether the current repository is configured to push freshly created branches up to the origin remote.\n\n```go\nfunc ValidateIsOnline() error\n```\nValidateIsOnline asserts that Git Town is not in offline mode\n\n```go\nfunc ValidateIsRepository() error\n```\nValidateIsRepository asserts that the current directory is in a repository\n\n","path":"github.com/keysolutions/git-town/src/git","name":"git","synopsis":"","isRedistributable":true}
